@SupportedOptions(value={"nolocations","annotations"}) @SupportedSourceVersion(value=RELEASE_8) public class Locations extends SourceChecker
javac -proc:only -processor org.checkerframework.common.util.count.Locations MyFile.java ...
Counting the number of lines of the processor's output yields the annotation location count
(e.g., by piping the output to wc
). Because the processor outputs a single line of text
describing type of each annotation location it encounters, you can obtain the count for specific
annotation location types (i.e., possible local variable annotations, or possible method receiver
annotations) by filtering the output accordingly (e.g., with grep
).
By default, this utility displays annotation locations only. The following two options may be used to adjust the output:
-Aannotations
: prints, on the same line as each location, information about the
annotation that is written there, if any
-Anolocations
: suppresses location output; only makes sense in conjunction with
-Aannotations
SourceChecker.CheckerError
currentRoot, DETAILS_SEPARATOR, errsOnLastExit, messager, messages, MSGS_FILE, parentChecker, SUPPRESS_ALL_KEY, trees, upstreamCheckerNames, visitor
processingEnv
Constructor and Description |
---|
Locations() |
Modifier and Type | Method and Description |
---|---|
protected SourceVisitor<?,?> |
createSourceVisitor()
Provides the
SourceVisitor that the checker should use to scan input source trees. |
AnnotationProvider |
getAnnotationProvider() |
addOptions, createSupportedLintOptions, errorAbort, errorAbort, expandCFOptions, formatStackTrace, fullMessageOf, getChecker, getContext, getElementUtils, getLintOption, getLintOption, getMessages, getOption, getOption, getOptionConfiguration, getOptions, getProcessingEnvironment, getProperties, getStandardSuppressWarningsKeys, getSupportedAnnotationTypes, getSupportedLintOptions, getSupportedOptions, getSupportedSourceVersion, getSuppressWarningsKeys, getTreeUtils, getTypeUtils, getUpstreamCheckerNames, getVisitor, hasOption, init, initChecker, message, message, printStats, processArg, report, setLintOption, setParentChecker, setProcessingEnvironment, setSupportedLintOptions, shouldAddShutdownHook, shouldSkipDefs, shouldSkipDefs, shouldSkipUses, shouldSkipUses, shouldSuppressWarnings, shouldSuppressWarnings, shutdownHook, treeToFilePositionString, typeProcess, typeProcessingStart, userErrorAbort, useUncheckedCodeDefault
process, typeProcessingOver
getCompletions, isInitialized
protected SourceVisitor<?,?> createSourceVisitor()
SourceChecker
SourceVisitor
that the checker should use to scan input source trees.createSourceVisitor
in class SourceChecker
SourceVisitor
to use to scan source treespublic AnnotationProvider getAnnotationProvider()
getAnnotationProvider
in interface BaseContext
getAnnotationProvider
in class SourceChecker