public class TypeAnnotator extends AnnotatedTypeScanner<java.lang.Void,java.lang.Void>
ImplicitFor
annotation and applies implicit
annotations specified by ImplicitFor
for any type whose visitor is
not overridden or does not call super
; it is designed to be invoked
from
AnnotatedTypeFactory.annotateImplicit(Element, AnnotatedTypeMirror)
and
AnnotatedTypeFactory.annotateImplicit(Tree, AnnotatedTypeMirror)
.
TypeAnnotator
traverses types deeply by default, except that it skips
the method receiver of executable types (for interoperability with
AnnotatedTypeFactory.annotateInheritedFromClass(AnnotatedTypeMirror)
).
This class takes care of two of the attributes of ImplicitFor
;
the others are handled in TreeAnnotator
.
TreeAnnotator
visitedNodes
Constructor and Description |
---|
TypeAnnotator(AnnotatedTypeFactory atypeFactory)
Creates a
TypeAnnotator from the given checker, using that checker's
TypeQualifiers annotation to determine the annotations that are
in the type hierarchy. |
Modifier and Type | Method and Description |
---|---|
void |
addTypeClass(java.lang.Class<? extends AnnotatedTypeMirror> typeClass,
javax.lang.model.element.AnnotationMirror theQual) |
void |
addTypeKind(javax.lang.model.type.TypeKind typeKind,
javax.lang.model.element.AnnotationMirror theQual) |
void |
addTypeName(java.lang.Class<?> typeName,
javax.lang.model.element.AnnotationMirror theQual) |
protected java.lang.Void |
scan(AnnotatedTypeMirror type,
java.lang.Void p)
Processes an element by calling e.accept(this, p); this method
may be overridden by subclasses.
|
java.lang.Void |
visitExecutable(AnnotatedTypeMirror.AnnotatedExecutableType t,
java.lang.Void p)
Visits an executable type.
|
reduce, reset, scan, scanAndReduce, scanAndReduce, visit, visit, visitArray, visitDeclared, visitIntersection, visitNoType, visitNull, visitPrimitive, visitTypeVariable, visitUnion, visitWildcard
public TypeAnnotator(AnnotatedTypeFactory atypeFactory)
TypeAnnotator
from the given checker, using that checker's
TypeQualifiers
annotation to determine the annotations that are
in the type hierarchy.public void addTypeKind(javax.lang.model.type.TypeKind typeKind, javax.lang.model.element.AnnotationMirror theQual)
public void addTypeClass(java.lang.Class<? extends AnnotatedTypeMirror> typeClass, javax.lang.model.element.AnnotationMirror theQual)
public void addTypeName(java.lang.Class<?> typeName, javax.lang.model.element.AnnotationMirror theQual)
protected java.lang.Void scan(AnnotatedTypeMirror type, java.lang.Void p)
AnnotatedTypeScanner
scan
in class AnnotatedTypeScanner<java.lang.Void,java.lang.Void>
type
public java.lang.Void visitExecutable(AnnotatedTypeMirror.AnnotatedExecutableType t, java.lang.Void p)
AnnotatedTypeVisitor
visitExecutable
in interface AnnotatedTypeVisitor<java.lang.Void,java.lang.Void>
visitExecutable
in class AnnotatedTypeScanner<java.lang.Void,java.lang.Void>
t
- the type to visitp
- a visitor-specified parameter