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
@SupportedSourceVersion(value=RELEASE_7)
@SupportedLintOptions(value="flow")
@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). 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 |
getDefaultSkipPattern, getLintOption, getLintOption, getMessages, getProcessingEnvironment, getShouldSkip, getSupportedAnnotationTypes, getSupportedOptions, 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 returns a type factory whose qualified class
name is the qualified name of the checker with 'Factory' in place
of 'Checker'. If no factory is found, it returns
AnnotatedTypeFactory
.
Subclasses may override this to construct the appropriate factory.
- Overrides:
createFactory
in class BaseTypeChecker
- Parameters:
root
- the currently visited compilation unit
- Returns:
- the appropriate type factory
getSupportedTypeQualifiers
public Set<Class<? extends Annotation>> getSupportedTypeQualifiers()
- 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:
getSupportedTypeQualifiers
in class BaseTypeChecker
- Returns:
- the type qualifiers supported this processor, or an empty
set if none
- See Also:
TypeQualifiers