public abstract class AggregateChecker extends AbstractTypeProcessor
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.Modifier and Type | Field and Description |
---|---|
protected List<SourceChecker> |
checkers |
processingEnv
Constructor and Description |
---|
AggregateChecker() |
Modifier and Type | Method and Description |
---|---|
Set<@ReadOnly String> |
getSupportedAnnotationTypes() |
protected abstract Collection<Class<? extends SourceChecker>> |
getSupportedCheckers()
Returns the list of supported checkers to be run together.
|
Set<@ReadOnly String> |
getSupportedOptions() |
SourceVersion |
getSupportedSourceVersion() |
void |
init(ProcessingEnvironment env)
Register a TaskListener that will get called after FLOW.
|
void |
typeProcess(TypeElement element,
@Nullable TreePath tree)
Processes a fully analyzed class that contains a supported annotation
(look
AbstractProcessor.getSupportedAnnotationTypes() ). |
void |
typeProcessingOver()
A method to be called once all the classes are processed and no error
is reported.
|
void |
typeProcessingStart()
A method to be called once before the first call to typeProcess.
|
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 typeProcessingStart()
AbstractTypeProcessor
Subclasses may override this method to do any initialization work.
typeProcessingStart
in class AbstractTypeProcessor
public final void typeProcess(TypeElement element, @Nullable TreePath tree)
AbstractTypeProcessor
AbstractProcessor.getSupportedAnnotationTypes()
).
The passed class is always valid type-checked Java code.
typeProcess
in class AbstractTypeProcessor
element
- element of the analyzed classtree
- the tree path to the element, with the leaf being a
ClassTree
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<@ReadOnly String> getSupportedOptions()
getSupportedOptions
in interface Processor
getSupportedOptions
in class AbstractProcessor
public final Set<@ReadOnly String> getSupportedAnnotationTypes()
getSupportedAnnotationTypes
in interface Processor
getSupportedAnnotationTypes
in class AbstractProcessor
public final SourceVersion getSupportedSourceVersion()
getSupportedSourceVersion
in interface Processor
getSupportedSourceVersion
in class AbstractProcessor