public abstract class AggregateChecker extends SourceChecker
There is no communication, interaction, or cooperation between the component checkers, even to the extent of being able to read one another's qualifiers. An aggregate checker is merely shorthand to invoke a sequence of checkers.
This class delegates AbstractTypeProcessor responsibilities to each component checker.
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 |
currentRoot, DETAILS_SEPARATOR, elementsWithSuppressedWarnings, errsOnLastExit, messager, messages, MSGS_FILE, parentChecker, SUPPRESS_ALL_KEY, trees, UNNEEDED_SUPPRESSION_KEY, upstreamCheckerNames, visitorprocessingEnv| Constructor and Description |
|---|
AggregateChecker() |
| Modifier and Type | Method and Description |
|---|---|
protected SourceVisitor<?,?> |
createSourceVisitor()
Provides the
SourceVisitor that the checker should use to scan input source trees. |
Map<String,String> |
getOptions()
Return all active options for this checker.
|
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()
Map the Checker Framework version of
SupportedOptions to the standard annotation
provided version SupportedOptions. |
void |
initChecker()
Initialize the checker.
|
protected void |
setProcessingEnvironment(ProcessingEnvironment env)
processingEnv needs to be set on each checker since we are not calling init on the checker,
which leaves it null.
|
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.
|
addOptions, createSupportedLintOptions, expandCFOptions, formatStackTrace, fullMessageOf, getAnnotationProvider, getBooleanOption, getBooleanOption, getChecker, getContext, getElementUtils, getLintOption, getLintOption, getMessages, getOption, getOption, getOptionConfiguration, getProcessingEnvironment, getProperties, getStandardSuppressWarningsKeys, getSupportedAnnotationTypes, getSupportedSourceVersion, getSuppressWarningsKeys, getTreeUtils, getTypeUtils, getUpstreamCheckerNames, getVisitor, hasOption, init, message, printMessage, printStats, processArg, report, setLintOption, setParentChecker, setRoot, setSupportedLintOptions, shouldAddShutdownHook, shouldSkipDefs, shouldSkipDefs, shouldSkipUses, shouldSkipUses, shouldSuppressWarnings, shouldSuppressWarnings, shutdownHook, treeToFilePositionString, typeProcessingStart, useUncheckedCodeDefault, warnUnneededSuppressions, warnUnneedSuppressionsprocessgetCompletions, isInitializedprotected final List<SourceChecker> checkers
protected abstract Collection<Class<? extends SourceChecker>> getSupportedCheckers()
protected void setProcessingEnvironment(ProcessingEnvironment env)
setProcessingEnvironment in class SourceCheckerpublic void initChecker()
SourceCheckerinitChecker in class SourceCheckerAbstractProcessor.init(ProcessingEnvironment)public final void typeProcess(TypeElement element, TreePath tree)
SourceCheckertypeProcess in class SourceCheckerelement - element of the analyzed classtree - the tree path to the element, with the leaf being a ClassTreeProcessor.process(Set, RoundEnvironment)public void typeProcessingOver()
AbstractTypeProcessorSubclasses 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 AbstractTypeProcessorpublic final Set<String> getSupportedOptions()
SourceCheckerSupportedOptions to the standard annotation
provided version SupportedOptions.getSupportedOptions in interface ProcessorgetSupportedOptions in interface OptionConfigurationgetSupportedOptions in class SourceCheckerpublic final Map<String,String> getOptions()
SourceCheckergetOptions in interface OptionConfigurationgetOptions in class SourceCheckerpublic final Set<String> getSupportedLintOptions()
SourceCheckerSourceChecker.getLintOption(java.lang.String).getSupportedLintOptions in class SourceCheckerSet of the lint options recognized by this checkerprotected SourceVisitor<?,?> createSourceVisitor()
SourceCheckerSourceVisitor that the checker should use to scan input source trees.createSourceVisitor in class SourceCheckerSourceVisitor to use to scan source trees