public class TypeAnnotator extends AnnotatedTypeScanner<Void,ElementKind>
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(BaseTypeChecker checker,
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(Class<? extends AnnotatedTypeMirror> typeClass,
AnnotationMirror theQual) |
void |
addTypeKind(TypeKind typeKind,
AnnotationMirror theQual) |
void |
addTypeName(Class<?> typeName,
AnnotationMirror theQual) |
protected Void |
scan(AnnotatedTypeMirror type,
ElementKind p)
Processes an element by calling e.accept(this, p); this method
may be overridden by subclasses.
|
Void |
visitExecutable(AnnotatedTypeMirror.AnnotatedExecutableType t,
ElementKind p)
Visits an executable type.
|
reduce, scan, scanAndReduce, scanAndReduce, visit, visit, visitArray, visitDeclared, visitIntersection, visitNoType, visitNull, visitPrimitive, visitTypeVariable, visitWildcard
public TypeAnnotator(BaseTypeChecker checker, AnnotatedTypeFactory atypeFactory)
TypeAnnotator
from the given checker, using that checker's
TypeQualifiers
annotation to determine the annotations that are
in the type hierarchy.checker
- the type checker to which this annotator belongspublic void addTypeKind(TypeKind typeKind, AnnotationMirror theQual)
public void addTypeClass(Class<? extends AnnotatedTypeMirror> typeClass, AnnotationMirror theQual)
public void addTypeName(Class<?> typeName, AnnotationMirror theQual)
protected Void scan(AnnotatedTypeMirror type, ElementKind p)
AnnotatedTypeScanner
scan
in class AnnotatedTypeScanner<Void,ElementKind>
type
public Void visitExecutable(AnnotatedTypeMirror.AnnotatedExecutableType t, ElementKind p)
AnnotatedTypeVisitor
visitExecutable
in interface AnnotatedTypeVisitor<Void,ElementKind>
visitExecutable
in class AnnotatedTypeScanner<Void,ElementKind>
t
- the type to visitp
- a visitor-specified parameter