public class KeyForSubchecker extends BaseTypeChecker
SourceChecker.CheckerError
Modifier and Type | Field and Description |
---|---|
protected @Nullable AnnotationMirror |
KEYFOR |
currentPath, currentRoot, env, messager, messages, trees
processingEnv
Constructor and Description |
---|
KeyForSubchecker() |
Modifier and Type | Method and Description |
---|---|
protected @Nullable QualifierHierarchy |
createQualifierHierarchy()
Returns the type qualifier hierarchy graph to be used by this processor.
|
protected TypeHierarchy |
createTypeHierarchy()
Creates the type subtyping checker using the current type qualifier
hierarchy.
|
void |
initChecker(ProcessingEnvironment env)
Initialize the checker.
|
boolean |
isSubtype(@Mutable AnnotatedTypeMirror rhs,
@Mutable AnnotatedTypeMirror lhs)
Tests whether one annotated type is a subtype of another, with
respect to the annotations on these types.
|
createFactory, createQualifierHierarchyFactory, createSourceVisitor, createSupportedTypeQualifiers, getQualifierHierarchy, getSupportedLintOptions, getSupportedTypeQualifiers, invokeConstructorFor, isAssignable
errorAbort, errorAbort, formatStackTrace, fullMessageOf, getLintOption, getLintOption, getMessages, getProcessingEnvironment, getSupportedAnnotationTypes, getSupportedOptions, getSupportedSourceVersion, getSuppressWarningsKey, init, message, report, shouldSkipDefs, shouldSkipDefs, shouldSkipUses, typeProcess
process, typeProcessingOver
getCompletions, isInitialized, toString
protected @Nullable AnnotationMirror KEYFOR
public void initChecker(ProcessingEnvironment env)
SourceChecker
initChecker
in class BaseTypeChecker
AbstractProcessor.init(ProcessingEnvironment)
protected TypeHierarchy createTypeHierarchy()
BaseTypeChecker
createTypeHierarchy
in class BaseTypeChecker
public final boolean isSubtype(@Mutable AnnotatedTypeMirror rhs, @Mutable AnnotatedTypeMirror lhs)
BaseTypeChecker
TypeHierarchy
. Its behavior is undefined for any annotations
not specified by either TypeQualifiers
or the result of
BaseTypeChecker.getSupportedTypeQualifiers()
.isSubtype
in class BaseTypeChecker
rhs
- the child typelhs
- the parent typesub
is a subtype of sup
protected @Nullable QualifierHierarchy createQualifierHierarchy()
BaseTypeChecker
BaseTypeChecker.getSupportedTypeQualifiers()
using the
meta-annotations found in them. The current implementation returns an
instance of GraphQualifierHierarchy
.
Subclasses may override this method to express any relationships that
cannot be inferred using meta-annotations (e.g. due to lack of
meta-annotations).createQualifierHierarchy
in class BaseTypeChecker