checkers.util
Class BasicChecker
java.lang.Object
javax.annotation.processing.AbstractProcessor
checkers.source.SourceChecker
checkers.basetype.BaseTypeChecker
checkers.util.BasicChecker
- All Implemented Interfaces:
- Processor
- Direct Known Subclasses:
- FlowTestChecker, TestChecker
@SupportedOptions(value="quals")
public class BasicChecker
- extends BaseTypeChecker
A checker for type qualifier systems that only checks subtyping
relationships.
The annotation(s) are specified on the command line, using an annotation
processor argument:
-Aquals
: specifies the annotations in the qualifier hierarchy
(as a comma-separated list of fully-qualified annotation names with no
spaces in between). Only the annotation for one qualified subtype
hierarchy can be passed.
Field Summary |
protected static boolean |
FLOW_BY_DEFAULT
Whether flow is enabled if no lint option is provided. |
Methods inherited from class checkers.source.SourceChecker |
getLintOption, getLintOption, getMessages, getProcessingEnvironment, getShouldSkip, getSupportedAnnotationTypes, getSupportedOptions, getSupportedSourceVersion, getSuppressWarningsKey, message, process, report, shouldSkip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FLOW_BY_DEFAULT
protected static boolean FLOW_BY_DEFAULT
- Whether flow is enabled if no lint option is provided.
BasicChecker
public BasicChecker()
init
public void init(ProcessingEnvironment p)
- Description copied from class:
SourceChecker
-
- Specified by:
init
in interface Processor
- Overrides:
init
in class BaseTypeChecker
- See Also:
AbstractProcessor.init(javax.annotation.processing.ProcessingEnvironment)
createFactory
public AnnotatedTypeFactory createFactory(CompilationUnitTree root)
- Description copied from class:
BaseTypeChecker
- Constructs an instance of the appropriate type factory for the
implemented type system.
The default implementation uses the checker naming convention to create
the appropriate type factory. If no factory is found, it returns
AnnotatedTypeFactory
. It reflectively invokes the constructor
that accepts this checker and compilation unit tree (in that order)
as arguments.
Subclasses have to override this method to create the appropriate
visitor if they do not follow the checker naming convention.
- Overrides:
createFactory
in class BaseTypeChecker
- Parameters:
root
- the currently visited compilation unit
- Returns:
- the appropriate type factory
createSupportedTypeQualifiers
protected Set<Class<? extends Annotation>> createSupportedTypeQualifiers()
- Description copied from class:
BaseTypeChecker
- If the checker class is annotated with
TypeQualifiers
, return an immutable set with the same set
of classes as the annotation. If the class is not so annotated,
return an empty set.
Subclasses may override this method to return an immutable set
of their supported type qualifiers.
- Overrides:
createSupportedTypeQualifiers
in class BaseTypeChecker
- Returns:
- the type qualifiers supported this processor, or an empty
set if none
- See Also:
TypeQualifiers