checkers.util
Class BasicChecker

java.lang.Object
  extended by javax.annotation.processing.AbstractProcessor
      extended by checkers.source.SourceChecker
          extended by checkers.basetype.BaseTypeChecker
              extended by 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:


Field Summary
protected static boolean FLOW_BY_DEFAULT
          Whether flow is enabled if no lint option is provided.
 
Fields inherited from class checkers.basetype.BaseTypeChecker
qualHierarchy
 
Fields inherited from class checkers.source.SourceChecker
currentRoot, env, messager, messages, skipPattern, trees, visitor
 
Fields inherited from class javax.annotation.processing.AbstractProcessor
processingEnv
 
Constructor Summary
BasicChecker()
           
 
Method Summary
 AnnotatedTypeFactory createFactory(CompilationUnitTree root)
          Constructs an instance of the appropriate type factory for the implemented type system.
 Set<Class<? extends Annotation>> getSupportedTypeQualifiers()
          If the checker class is annotated with TypeQualifiers, return an immutable set with the same set of classes as the annotation.
 void init(ProcessingEnvironment p)
          
 
Methods inherited from class checkers.basetype.BaseTypeChecker
createQualifierHierarchy, createTypeHierarchy, getQualifierHierarchy, getSourceVisitor, getSupportedLintOptions, isAssignable, isSubtype, isValidUse
 
Methods inherited from class checkers.source.SourceChecker
getDefaultSkipPattern, getLintOption, getLintOption, getMessages, getProcessingEnvironment, getShouldSkip, getSupportedAnnotationTypes, getSupportedOptions, getSuppressWarningsKey, message, process, report, shouldSkip
 
Methods inherited from class javax.annotation.processing.AbstractProcessor
getCompletions, getSupportedSourceVersion, isInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FLOW_BY_DEFAULT

protected static boolean FLOW_BY_DEFAULT
Whether flow is enabled if no lint option is provided.

Constructor Detail

BasicChecker

public BasicChecker()
Method Detail

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