public class TypeAnnotator extends AnnotatedTypeScanner<@Nullable 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)
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 |
---|---|
protected @Nullable Void |
scan(@Mutable AnnotatedTypeMirror type,
ElementKind p)
Processes an element by calling e.accept(this, p); this method
may be overridden by subclasses.
|
@Nullable Void |
visitExecutable(AnnotatedTypeMirror.AnnotatedExecutableType t,
ElementKind p)
Visits an executable type.
|
reduce, scan, scanAndReduce, scanAndReduce, visit, visit, visitArray, visitDeclared, visitNoType, visitNull, visitPrimitive, visitTypeVariable, visitWildcard
public TypeAnnotator(BaseTypeChecker checker)
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 belongsprotected @Nullable Void scan(@Mutable AnnotatedTypeMirror type, ElementKind p)
AnnotatedTypeScanner
scan
in class AnnotatedTypeScanner<@Nullable Void,ElementKind>
type
public @Nullable Void visitExecutable(AnnotatedTypeMirror.AnnotatedExecutableType t, ElementKind p)
AnnotatedTypeVisitor
visitExecutable
in interface AnnotatedTypeVisitor<@Nullable Void,ElementKind>
visitExecutable
in class AnnotatedTypeScanner<@Nullable Void,ElementKind>
t
- the type to visitp
- a visitor-specified parameter