Class AggregateChecker
java.lang.Object
javax.annotation.processing.AbstractProcessor
org.checkerframework.javacutil.AbstractTypeProcessor
org.checkerframework.framework.source.SourceChecker
org.checkerframework.framework.source.AggregateChecker
- All Implemented Interfaces:
- Processor,- OptionConfiguration
- Direct Known Subclasses:
- I18nChecker
An aggregate checker that packages multiple checkers together. The resulting checker invokes the
 component checkers in turn on the processed files.
 
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.
- 
Field SummaryFieldsFields inherited from class org.checkerframework.framework.source.SourceCheckercurrentRoot, DETAILS_SEPARATOR, elements, elementsWithSuppressedWarnings, errsOnLastExit, javacErrored, messager, messagesProperties, MSGS_FILE, OPTION_SEPARATOR, parentChecker, SUPPRESS_ALL_MESSAGE_KEY, SUPPRESS_ALL_PREFIX, trees, types, UNNEEDED_SUPPRESSION_KEY, upstreamCheckerNames, useAllcheckersPrefix, visitorFields inherited from class javax.annotation.processing.AbstractProcessorprocessingEnv
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected SourceVisitor<?,?> Provides theSourceVisitorthat the checker should use to scan input source trees.Return all active options for this checker.protected abstract Collection<Class<? extends SourceChecker>>Returns the list of supported checkers to be run together.Returns the lint options recognized by this checker.Map the Checker Framework version ofSupportedOptionsto the standard annotation provided versionSupportedOptions.voidInitialize the checker.protected voidprocessingEnv needs to be set on each checker since we are not calling init on the checker, which leaves it null.final voidtypeProcess(TypeElement element, TreePath tree) Type-check the code using this checker's visitor.voidA method to be called once all the classes are processed.Methods inherited from class org.checkerframework.framework.source.SourceCheckeraddOptions, createSupportedLintOptions, expandCFOptions, fullMessageOf, getAnnotationProvider, getBooleanOption, getBooleanOption, getElementUtils, getLintOption, getLintOption, getMessagesProperties, getOption, getOption, getOptionConfiguration, getParentChecker, getPathToCompilationUnit, getProcessingEnvironment, getProperties, getStandardSuppressWarningsPrefixes, getSupportedAnnotationTypes, getSupportedSourceVersion, getSuppressWarningsPrefixes, getTreeUtils, getTypeUtils, getUpstreamCheckerNames, getVisitor, hasOption, init, message, message, printOrStoreMessage, printOrStoreMessage, printStats, processArg, report, reportError, reportJavacError, reportWarning, setLintOption, setParentChecker, setRoot, setSupportedLintOptions, shouldAddShutdownHook, shouldSkipDefs, shouldSkipDefs, shouldSkipUses, shouldSkipUses, shouldSuppressWarnings, shouldSuppressWarnings, shouldSuppressWarnings, shutdownHook, typeProcessingStart, useConservativeDefault, warnUnneededSuppressions, warnUnneededSuppressionsMethods inherited from class org.checkerframework.javacutil.AbstractTypeProcessorgetCompilerLog, processMethods inherited from class javax.annotation.processing.AbstractProcessorgetCompletions, isInitialized
- 
Field Details- 
checkers
 
- 
- 
Constructor Details- 
AggregateCheckerprotected AggregateChecker()Create a new AggregateChecker.
 
- 
- 
Method Details- 
getSupportedCheckersReturns the list of supported checkers to be run together. Subclasses need to override this method.- Returns:
- the list of checkers to be run
 
- 
setProcessingEnvironmentprocessingEnv needs to be set on each checker since we are not calling init on the checker, which leaves it null. If one of checkers is an AggregateChecker, its visitors will try use checker's processing env which should not be null.- Overrides:
- setProcessingEnvironmentin class- SourceChecker
- Parameters:
- env- the new processing environment
 
- 
initCheckerpublic void initChecker()Description copied from class:SourceCheckerInitialize the checker.- Overrides:
- initCheckerin class- SourceChecker
- See Also:
 
- 
typeProcessDescription copied from class:SourceCheckerType-check the code using this checker's visitor.- Overrides:
- typeProcessin class- SourceChecker
- Parameters:
- element- element of the analyzed class
- tree- the tree path to the element, with the leaf being a- ClassTree
- See Also:
 
- 
typeProcessingOverpublic void typeProcessingOver()Description copied from class:AbstractTypeProcessorA method to be called once all the classes are processed.Subclasses may override this method to do any aggregate analysis (e.g. generate report, persistence) or resource deallocation. Method AbstractTypeProcessor.getCompilerLog()can be used to access the number of compiler errors.- Overrides:
- typeProcessingOverin class- AbstractTypeProcessor
 
- 
getSupportedOptionsDescription copied from class:SourceCheckerMap the Checker Framework version ofSupportedOptionsto the standard annotation provided versionSupportedOptions.- Specified by:
- getSupportedOptionsin interface- OptionConfiguration
- Specified by:
- getSupportedOptionsin interface- Processor
- Overrides:
- getSupportedOptionsin class- SourceChecker
 
- 
getOptionsDescription copied from interface:OptionConfigurationReturn all active options for this checker.- Specified by:
- getOptionsin interface- OptionConfiguration
- Overrides:
- getOptionsin class- SourceChecker
- Returns:
- all active options for this checker
 
- 
getSupportedLintOptionsDescription copied from class:SourceCheckerReturns the lint options recognized by this checker. Lint options are those which can be checked for viaSourceChecker.getLintOption(java.lang.String).- Overrides:
- getSupportedLintOptionsin class- SourceChecker
- Returns:
- an unmodifiable Setof the lint options recognized by this checker
 
- 
createSourceVisitorDescription copied from class:SourceCheckerProvides theSourceVisitorthat the checker should use to scan input source trees.- Specified by:
- createSourceVisitorin class- SourceChecker
- Returns:
- a SourceVisitorto use to scan source trees
 
 
-