checkers.basic
Class BasicChecker

java.lang.Object
  extended by javax.annotation.processing.AbstractProcessor
      extended by com.sun.source.util.AbstractTypeProcessor
          extended by checkers.source.SourceChecker
              extended by checkers.basetype.BaseTypeChecker
                  extended by checkers.basic.BasicChecker
All Implemented Interfaces:
Processor

@SupportedOptions(value="quals")
public final 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
 
Fields inherited from class checkers.source.SourceChecker
currentPath, currentRoot, env, messager, messages, skipPattern, trees
 
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.
protected  Set<Class<? extends Annotation>> createSupportedTypeQualifiers()
          If the checker class is annotated with TypeQualifiers, return an immutable set with the same set of classes as the annotation.
protected  Collection<String> getSuppressWarningsKey()
           
 
Methods inherited from class checkers.basetype.BaseTypeChecker
createQualifierHierarchy, createSourceVisitor, createTypeHierarchy, getQualifierHierarchy, getSupportedLintOptions, getSupportedTypeQualifiers, init, isAssignable, isSubtype, isValidUse
 
Methods inherited from class checkers.source.SourceChecker
getLintOption, getLintOption, getMessages, getProcessingEnvironment, getShouldSkip, getSupportedAnnotationTypes, getSupportedOptions, getSupportedSourceVersion, message, report, shouldSkip, typeProcess
 
Methods inherited from class com.sun.source.util.AbstractTypeProcessor
process, typeProcessingOver
 
Methods inherited from class javax.annotation.processing.AbstractProcessor
getCompletions, isInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicChecker

public BasicChecker()
Method Detail

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 BasicAnnotatedTypeFactory. 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

getSuppressWarningsKey

protected Collection<String> getSuppressWarningsKey()
Overrides:
getSuppressWarningsKey in class SourceChecker
Returns:
String keys that a checker honors for suppressing warnings and errors that it issues
See Also:
SuppressWarningsKey