Class ImportForbiddenGrader.ImportCheckerAdapter
- Enclosing class:
- ImportForbiddenGrader
protected abstract class ImportForbiddenGrader.ImportCheckerAdapter
extends com.github.javaparser.ast.visitor.VoidVisitorAdapter<List<Result>>
Abstract superclass of adapters testing whether forbidden imports appear.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static String
importToPackageName
(com.github.javaparser.ast.ImportDeclaration importDecl) Converts an import to a package name.protected abstract boolean
isImportForbidden
(com.github.javaparser.ast.ImportDeclaration importDecl) Checks whether the given import declaration is forbidden.void
Methods inherited from class com.github.javaparser.ast.visitor.VoidVisitorAdapter
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
-
Constructor Details
-
ImportCheckerAdapter
protected ImportCheckerAdapter()Constructs an adapter.
-
-
Method Details
-
importToPackageName
Converts an import to a package name.- Parameters:
importDecl
- an import declaration- Returns:
- the package name
-
isImportForbidden
protected abstract boolean isImportForbidden(com.github.javaparser.ast.ImportDeclaration importDecl) Checks whether the given import declaration is forbidden.- Parameters:
importDecl
- the import declaration- Returns:
- true if it is forbidden, false if it is permitted
-
visit
-