public abstract class AggregateChecker extends SourceChecker
AbstractTypeProcessor
responsibilities to each
of the checkers.
Checker writers need to subclass this class and only override
getSupportedCheckers()
to indicate the classes of the checkers
to be bundled.SourceChecker.CheckerError
Modifier and Type | Field and Description |
---|---|
protected List<SourceChecker> |
checkers |
currentPath, currentRoot, DETAILS_SEPARATOR, messager, messages, trees
processingEnv
Constructor and Description |
---|
AggregateChecker() |
Modifier and Type | Method and Description |
---|---|
protected SourceVisitor<?,?> |
createSourceVisitor(CompilationUnitTree root)
Provides the
SourceVisitor that the checker should use to scan
input source trees. |
protected abstract Collection<Class<? extends SourceChecker>> |
getSupportedCheckers()
Returns the list of supported checkers to be run together.
|
Set<String> |
getSupportedLintOptions()
Returns the lint options recognized by this checker.
|
Set<String> |
getSupportedOptions() |
void |
init(ProcessingEnvironment env)
Register a TaskListener that will get called after FLOW.
|
void |
initChecker()
Initialize the checker.
|
void |
typeProcess(TypeElement element,
TreePath tree)
Type-check the code with Java specifications and then runs the Checker
Rule Checking visitor on the processed source.
|
void |
typeProcessingOver()
A method to be called once all the classes are processed and no error
is reported.
|
createFactory, createSupportedLintOptions, errorAbort, errorAbort, formatStackTrace, fullMessageOf, getLintOption, getLintOption, getMessages, getProcessingEnvironment, getProperties, getSupportedAnnotationTypes, getSupportedSourceVersion, getSuppressWarningsKey, message, printStats, report, setLintOption, setSupportedLintOptions, shouldAddShutdownHook, shouldSkipDefs, shouldSkipDefs, shouldSkipUses, shutdownHook, typeProcessingStart
process
getCompletions, isInitialized, toString
protected List<SourceChecker> checkers
protected abstract Collection<Class<? extends SourceChecker>> getSupportedCheckers()
public final void init(ProcessingEnvironment env)
AbstractTypeProcessor
init
in interface Processor
init
in class AbstractTypeProcessor
public void initChecker()
SourceChecker
initChecker
in class SourceChecker
AbstractProcessor.init(ProcessingEnvironment)
public final void typeProcess(TypeElement element, TreePath tree)
SourceChecker
typeProcess
in class SourceChecker
element
- element of the analyzed classtree
- the tree path to the element, with the leaf being a
ClassTree
Processor.process(Set, RoundEnvironment)
public void typeProcessingOver()
AbstractTypeProcessor
Subclasses may override this method to do any aggregate analysis (e.g. generate report, persistence) or resource deallocation.
If an error (a Java error or a processor error) is reported, this method is not guaranteed to be invoked.
typeProcessingOver
in class AbstractTypeProcessor
public final Set<String> getSupportedOptions()
getSupportedOptions
in interface Processor
getSupportedOptions
in class SourceChecker
public final Set<String> getSupportedLintOptions()
SourceChecker
SourceChecker.getLintOption(java.lang.String)
.getSupportedLintOptions
in class SourceChecker
Set
of the lint options recognized by
this checkerprotected SourceVisitor<?,?> createSourceVisitor(CompilationUnitTree root)
SourceChecker
SourceVisitor
that the checker should use to scan
input source trees.createSourceVisitor
in class SourceChecker
root
- the AST rootSourceVisitor
to use to scan source trees