Class ImportForbiddenGrader
java.lang.Object
com.spertus.jacquard.common.Grader
com.spertus.jacquard.syntaxgrader.SyntaxGrader
com.spertus.jacquard.syntaxgrader.SyntaxCheckGrader
com.spertus.jacquard.syntaxgrader.ImportForbiddenGrader
- Direct Known Subclasses:
ImportBlocklistedGrader
,ImportDisallowedGrader
Abstract superclass of graders that check whether there are any imports
of packages that are not allowed.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
Abstract superclass of adapters testing whether forbidden imports appear. -
Field Summary
Fields inherited from class com.spertus.jacquard.syntaxgrader.SyntaxCheckGrader
adapter, maxScorePerInstance
-
Constructor Summary
ModifierConstructorDescriptionprotected
ImportForbiddenGrader
(String name, double maxScore) Creates an import grader that tests whether there are any imports involving blocklisted (forbidden) packages. -
Method Summary
Modifier and TypeMethodDescriptionvoid
finalizeResults
(List<Result> results) Adds any results that cannot be computed until all visits are complete.void
Performs any setup before a call toSyntaxCheckGrader.grade(CompilationUnit)
.Methods inherited from class com.spertus.jacquard.syntaxgrader.SyntaxCheckGrader
grade, makeFailingResult, makeSuccessResult
Methods inherited from class com.spertus.jacquard.syntaxgrader.SyntaxGrader
getCallableSingleTarget
Methods inherited from class com.spertus.jacquard.common.Grader
getCallableMultiTarget, grade, grade, gradeAll, makeExceptionResult, makeExceptionResultList, makeFailureResult, makeFailureResultList, makePartialCreditResult, makeSuccessResult, makeSuccessResultList
-
Constructor Details
-
ImportForbiddenGrader
Creates an import grader that tests whether there are any imports involving blocklisted (forbidden) packages.- Parameters:
name
- the name of this checkermaxScore
- the number of points to award if none are included
-
-
Method Details
-
initialize
public void initialize()Description copied from class:SyntaxCheckGrader
Performs any setup before a call toSyntaxCheckGrader.grade(CompilationUnit)
.- Overrides:
initialize
in classSyntaxCheckGrader
-
finalizeResults
Description copied from class:SyntaxCheckGrader
Adds any results that cannot be computed until all visits are complete.- Overrides:
finalizeResults
in classSyntaxCheckGrader
- Parameters:
results
- the list of results, which may be mutated by this call
-