public class TreeAnnotator extends SimpleTreeVisitor<@Nullable Void,@Mutable AnnotatedTypeMirror>
ImplicitFor
annotation and applies implicit
annotations specified by ImplicitFor
for any tree 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)
.
TreeAnnotator
does not traverse trees deeply by default.
DEFAULT_VALUE
Constructor and Description |
---|
TreeAnnotator(BaseTypeChecker checker,
AnnotatedTypeFactory typeFactory)
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 |
addStringPattern(@ReadOnly String pattern,
@Nullable AnnotationMirror theQual) |
void |
addTreeClass(Class<? extends @Nullable Tree> treeClass,
@Nullable AnnotationMirror theQual) |
void |
addTreeKind(Tree.Kind treeKind,
@Nullable AnnotationMirror theQual) |
@Nullable Void |
defaultAction(@Nullable Tree tree,
@Mutable AnnotatedTypeMirror type) |
@Nullable Void |
visitLiteral(LiteralTree tree,
@Mutable AnnotatedTypeMirror type)
Go through the string patterns and add the greatest lower bound of all matching patterns.
|
@Nullable Void |
visitNewArray(NewArrayTree tree,
@Mutable AnnotatedTypeMirror type) |
visit, visit, visitAnnotatedType, visitAnnotation, visitArrayAccess, visitArrayType, visitAssert, visitAssignment, visitBinary, visitBlock, visitBreak, visitCase, visitCatch, visitClass, visitCompilationUnit, visitCompoundAssignment, visitConditionalExpression, visitContinue, visitDoWhileLoop, visitEmptyStatement, visitEnhancedForLoop, visitErroneous, visitExpressionStatement, visitForLoop, visitIdentifier, visitIf, visitImport, visitInstanceOf, visitLabeledStatement, visitLambdaExpression, visitMemberReference, visitMemberSelect, visitMethod, visitMethodInvocation, visitModifiers, visitNewClass, visitOther, visitParameterizedType, visitParenthesized, visitPrimitiveType, visitReturn, visitSwitch, visitSynchronized, visitThrow, visitTry, visitTypeCast, visitTypeParameter, visitUnary, visitUnionType, visitVariable, visitWhileLoop, visitWildcard
public TreeAnnotator(BaseTypeChecker checker, AnnotatedTypeFactory typeFactory)
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 addTreeClass(Class<? extends @Nullable Tree> treeClass, @Nullable AnnotationMirror theQual)
public void addTreeKind(Tree.Kind treeKind, @Nullable AnnotationMirror theQual)
public void addStringPattern(@ReadOnly String pattern, @Nullable AnnotationMirror theQual)
public @Nullable Void defaultAction(@Nullable Tree tree, @Mutable AnnotatedTypeMirror type)
defaultAction
in class SimpleTreeVisitor<@Nullable Void,@Mutable AnnotatedTypeMirror>
public @Nullable Void visitLiteral(LiteralTree tree, @Mutable AnnotatedTypeMirror type)
visitLiteral
in interface TreeVisitor<@Nullable Void,@Mutable AnnotatedTypeMirror>
visitLiteral
in class SimpleTreeVisitor<@Nullable Void,@Mutable AnnotatedTypeMirror>
public @Nullable Void visitNewArray(NewArrayTree tree, @Mutable AnnotatedTypeMirror type)
visitNewArray
in interface TreeVisitor<@Nullable Void,@Mutable AnnotatedTypeMirror>
visitNewArray
in class SimpleTreeVisitor<@Nullable Void,@Mutable AnnotatedTypeMirror>