checkers.nullness
Class KeyForSubchecker

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.nullness.KeyForSubchecker
All Implemented Interfaces:
Processor

@TypeQualifiers(value={KeyFor.class,Unqualified.class,KeyForBottom.class})
public class KeyForSubchecker
extends BaseTypeChecker

TODO: doc


Field Summary
Modifier and Type Field and Description
 
Fields inherited from class checkers.source.SourceChecker
currentPath, currentRoot, env, messager, messages, trees
 
Fields inherited from class javax.annotation.processing.AbstractProcessor
processingEnv
 
Constructor Summary
Constructor and Description
KeyForSubchecker()
           
 
Method Summary
Modifier and Type Method and Description
protected  TypeHierarchy createTypeHierarchy()
          Creates the type subtyping checker using the current type qualifier hierarchy.
 boolean isSubtype(AnnotatedTypeMirror rhs, AnnotatedTypeMirror lhs)
          Tests whether one annotated type is a subtype of another, with respect to the annotations on these types.
 
Methods inherited from class checkers.basetype.BaseTypeChecker
createFactory, createQualifierHierarchy, createSourceVisitor, createSupportedTypeQualifiers, getQualifierHierarchy, getSupportedLintOptions, getSupportedTypeQualifiers, init, isAssignable, isValidUse
 
Methods inherited from class checkers.source.SourceChecker
fullMessageOf, getLintOption, getLintOption, getMessages, getProcessingEnvironment, getShouldSkip, getSupportedAnnotationTypes, getSupportedOptions, getSupportedSourceVersion, getSuppressWarningsKey, message, report, typeProcess
 
Methods inherited from class com.sun.source.util.AbstractTypeProcessor
process, typeProcessingOver
 
Methods inherited from class javax.annotation.processing.AbstractProcessor
getCompletions, isInitialized, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyForSubchecker

public KeyForSubchecker()
Method Detail

createTypeHierarchy

protected TypeHierarchy createTypeHierarchy()
Description copied from class: BaseTypeChecker
Creates the type subtyping checker using the current type qualifier hierarchy. Subclasses may override this method to specify new type checking rules beyond the typical java subtyping rules.

Overrides:
createTypeHierarchy in class BaseTypeChecker
Returns:
the type relations class to check type subtyping

isSubtype

public final boolean isSubtype(AnnotatedTypeMirror rhs,
                               AnnotatedTypeMirror lhs)
Description copied from class: BaseTypeChecker
Tests whether one annotated type is a subtype of another, with respect to the annotations on these types. Subclasses may wish to ignore annotations that are not related to the type qualifiers they check. This implementation follows the subtype rules specified in TypeHierarchy. Its behavior is undefined for any annotations not specified by either TypeQualifiers or the result of BaseTypeChecker.getSupportedTypeQualifiers().

Overrides:
isSubtype in class BaseTypeChecker
Parameters:
rhs - the child type
lhs - the parent type
Returns:
true iff sub is a subtype of sup