public class CFGTranslationPhaseOne extends TreeScanner<Node,Void>
Label
s to positions in the node sequence.
Node
s.
The return type of this scanner is Node
. For expressions, the corresponding node is
returned to allow linking between different nodes.
However, for statements there is usually no single Node
that is created, and thus no
node is returned (rather, null is returned).
Every visit*
method is assumed to add at least one extended node to the list of nodes
(which might only be a jump).
The entry point to process a single body (e.g., method) is process(TreePath,
UnderlyingAST)
.
Modifier and Type | Field and Description |
---|---|
protected VariableTree |
ea
The
VariableTree that indicates whether assertions are enabled or not. |
protected Elements |
elements
The javac element utilities.
|
TreeBuilder |
treeBuilder
The tree builder.
|
protected long |
uid
The UID for the next unique name.
|
Constructor and Description |
---|
CFGTranslationPhaseOne(TreeBuilder treeBuilder,
AnnotationProvider annotationProvider,
boolean assumeAssertionsEnabled,
boolean assumeAssertionsDisabled,
ProcessingEnvironment env) |
Modifier and Type | Method and Description |
---|---|
protected void |
addLabelForNextNode(Label l)
Add the label
l to the extended node that will be placed next in the sequence. |
protected void |
addToConvertedLookupMap(Node node)
Add a node in the post-conversion lookup map.
|
protected void |
addToConvertedLookupMap(Tree tree,
Node node)
Add a node in the post-conversion lookup map.
|
protected void |
addToLookupMap(Node node)
Add a node to the lookup map if it not already present.
|
protected Node |
assignConvert(Node node,
TypeMirror varType)
Perform assignment conversion so that it can be assigned to a variable of the given type.
|
protected boolean |
assumeAssertionsEnabledFor(AssertTree tree)
Should assertions be assumed to be executed for a given
AssertTree ? False by default. |
protected Node |
binaryNumericPromotion(Node node,
TypeMirror exprType)
Perform binary numeric promotion on the input node to make it match the expression type.
|
protected TypeMirror |
binaryPromotedType(TypeMirror left,
TypeMirror right)
Compute the type to which two numeric types must be promoted before performing a binary numeric
operation on them.
|
protected Node |
box(Node node)
If the input node is an unboxed primitive type, insert a call to the appropriate valueOf
method, otherwise leave it alone.
|
protected Node |
commonConvert(Node node,
TypeMirror varType,
boolean contextAllowsNarrowing)
Assignment conversion and method invocation conversion are almost identical, except that
assignment conversion allows narrowing.
|
protected Node |
conditionalExprPromotion(Node node,
TypeMirror destType)
Convert an operand of a conditional expression to the type of the whole expression.
|
protected boolean |
conversionRequiresNarrowing(TypeMirror varType,
Node node)
Return whether a conversion from the type of the node to varType requires narrowing.
|
protected List<Node> |
convertCallArguments(ExecutableElement method,
List<? extends ExpressionTree> actualExprs)
Given a method element and as list of argument expressions, return a list of
Node s
representing the arguments converted for a call of the method. |
protected VariableTree |
createEnhancedForLoopArrayVariable(ExpressionTree expression,
VariableElement variableElement) |
protected VariableTree |
createEnhancedForLoopIteratorVariable(MethodInvocationTree iteratorCall,
VariableElement variableElement) |
protected org.checkerframework.dataflow.cfg.builder.NodeWithExceptionsHolder |
extendWithClassNameNode(ClassNameNode node)
Extend a list of extended nodes with a ClassName node.
|
protected void |
extendWithExtendedNode(ExtendedNode n)
Extend the list of extended nodes with an extended node.
|
protected void |
extendWithNode(Node node)
Extend the list of extended nodes with a node.
|
protected org.checkerframework.dataflow.cfg.builder.NodeWithExceptionsHolder |
extendWithNodeWithException(Node node,
TypeMirror cause)
Extend the list of extended nodes with a node, where
node might throw the exception
cause . |
protected org.checkerframework.dataflow.cfg.builder.NodeWithExceptionsHolder |
extendWithNodeWithExceptions(Node node,
Set<TypeMirror> causes)
Extend the list of extended nodes with a node, where
node might throw any of the
exceptions in causes . |
protected VariableTree |
getAssertionsEnabledVariable()
Get a synthetic
VariableTree that indicates whether assertions are enabled or not. |
TreePath |
getCurrentPath()
Returns the current path for the tree currently being scanned.
|
protected @Nullable Name |
getLabel(TreePath path)
Returns the label
Name of the leaf in the argument path, or null if the leaf is not a
labeled statement. |
protected ProcessingEnvironment |
getProcessingEnvironment()
Allow subclasses to access the processing environment and its associated utilities.
|
protected TypeMirror |
getTypeMirror(Class<?> clazz)
Returns the TypeMirror for the given class.
|
void |
handleArtificialTree(Tree tree)
Perform any actions required when CFG translation creates a new Tree that is not part of the
original AST.
|
protected void |
insertExtendedNodeAfter(ExtendedNode n,
Node pred)
Insert
n after the node pred in the list of extended nodes, or append n
if pred is not present. |
protected <T extends Node> |
insertNodeAfter(T node,
Node pred)
Insert
node after pred in the list of extended nodes, or append to the list if
pred is not present. |
protected org.checkerframework.dataflow.cfg.builder.NodeWithExceptionsHolder |
insertNodeWithExceptionsAfter(Node node,
Set<TypeMirror> causes,
Node pred)
Insert a
node that might throw the exceptions in causes after pred in
the list of extended nodes, or append to the list if pred is not present. |
protected boolean |
isNumericOrBoxed(TypeMirror type)
Returns true if the argument type is a numeric primitive or a boxed numeric primitive and false
otherwise.
|
protected @Nullable TypeMirror |
maybeGetTypeMirror(Class<?> clazz)
Returns the TypeMirror for the given class, or
null if the type is not present. |
protected Node |
methodInvocationConvert(Node node,
TypeMirror formalType)
Perform method invocation conversion so that the node can be passed as a formal parameter of
the given type.
|
protected Node |
narrow(Node node,
TypeMirror destType)
Perform narrowing conversion on the input node to make it match the destination type.
|
protected Node |
narrowAndBox(Node node,
TypeMirror destType)
Perform narrowing conversion and optionally boxing conversion on the input node to make it
match the destination type.
|
PhaseOneResult |
process(CompilationUnitTree root,
UnderlyingAST underlyingAST)
Process a single body within
root . |
PhaseOneResult |
process(TreePath bodyPath,
UnderlyingAST underlyingAST)
Performs the actual work of phase one: processing a single body (of a method, lambda, top-level
block, etc.).
|
Node |
scan(Tree tree,
Void p) |
protected Node |
stringConversion(Node node)
Convert the input node to String type, if it isn't already.
|
protected void |
translateAssertWithAssertionsEnabled(AssertTree tree)
Translates an assertion statement to the correct CFG nodes.
|
protected AssignmentNode |
translateAssignment(Tree tree,
Node target,
ExpressionTree rhs)
Translate an assignment.
|
protected AssignmentNode |
translateAssignment(Tree tree,
Node target,
Node expression)
Translate an assignment where the RHS has already been scanned.
|
protected Node |
unaryNumericPromotion(Node node)
Perform unary numeric promotion on the input node.
|
protected Node |
unbox(Node node)
If the input node is a boxed type, unbox it, otherwise leave it alone.
|
protected String |
uniqueName(String prefix)
Returns a unique name starting with
prefix . |
Node |
visitAnnotatedType(AnnotatedTypeTree tree,
Void p) |
Node |
visitAnnotation(AnnotationTree tree,
Void p) |
Node |
visitArrayAccess(ArrayAccessTree tree,
Void p) |
Node |
visitArrayType(ArrayTypeTree tree,
Void p) |
Node |
visitAssert(AssertTree tree,
Void p) |
Node |
visitAssignment(AssignmentTree tree,
Void p) |
Node |
visitBinary(BinaryTree tree,
Void p) |
Node |
visitBindingPattern17(Tree bindingPatternTree,
Void p)
Visit a BindingPatternTree
|
Node |
visitBlock(BlockTree tree,
Void p) |
Node |
visitBreak(BreakTree tree,
Void p) |
Node |
visitCase(CaseTree tree,
Void p) |
Node |
visitCatch(CatchTree tree,
Void p) |
Node |
visitClass(ClassTree tree,
Void p) |
Node |
visitCompilationUnit(CompilationUnitTree tree,
Void p) |
Node |
visitCompoundAssignment(CompoundAssignmentTree tree,
Void p) |
Node |
visitConditionalExpression(ConditionalExpressionTree tree,
Void p) |
Node |
visitContinue(ContinueTree tree,
Void p) |
Node |
visitDoWhileLoop(DoWhileLoopTree tree,
Void p) |
Node |
visitEmptyStatement(EmptyStatementTree tree,
Void p) |
Node |
visitEnhancedForLoop(EnhancedForLoopTree tree,
Void p) |
Node |
visitErroneous(ErroneousTree tree,
Void p) |
Node |
visitExpressionStatement(ExpressionStatementTree tree,
Void p) |
Node |
visitForLoop(ForLoopTree tree,
Void p) |
Node |
visitIdentifier(IdentifierTree tree,
Void p) |
Node |
visitIf(IfTree tree,
Void p) |
Node |
visitImport(ImportTree tree,
Void p) |
Node |
visitInstanceOf(InstanceOfTree tree,
Void p) |
Node |
visitLabeledStatement(LabeledStatementTree tree,
Void p) |
Node |
visitLambdaExpression(LambdaExpressionTree tree,
Void p) |
Node |
visitLiteral(LiteralTree tree,
Void p) |
Node |
visitMemberReference(MemberReferenceTree tree,
Void p) |
Node |
visitMemberSelect(MemberSelectTree tree,
Void p) |
Node |
visitMethod(MethodTree tree,
Void p) |
MethodInvocationNode |
visitMethodInvocation(MethodInvocationTree tree,
Void p) |
Node |
visitModifiers(ModifiersTree tree,
Void p) |
Node |
visitNewArray(NewArrayTree tree,
Void p) |
Node |
visitNewClass(NewClassTree tree,
Void p) |
Node |
visitOther(Tree tree,
Void p) |
Node |
visitParameterizedType(ParameterizedTypeTree tree,
Void p) |
Node |
visitParenthesized(ParenthesizedTree tree,
Void p) |
Node |
visitPrimitiveType(PrimitiveTypeTree tree,
Void p) |
Node |
visitReturn(ReturnTree tree,
Void p) |
Node |
visitSwitch(SwitchTree tree,
Void p) |
Node |
visitSwitchExpression17(Tree switchExpressionTree,
Void p)
Visit a SwitchExpressionTree
|
Node |
visitSynchronized(SynchronizedTree tree,
Void p) |
Node |
visitThrow(ThrowTree tree,
Void p) |
Node |
visitTry(TryTree tree,
Void p) |
Node |
visitTypeCast(TypeCastTree tree,
Void p) |
Node |
visitTypeParameter(TypeParameterTree tree,
Void p) |
Node |
visitUnary(UnaryTree tree,
Void p) |
Node |
visitUnionType(UnionTypeTree tree,
Void p) |
Node |
visitVariable(VariableTree tree,
Void p) |
Node |
visitWhileLoop(WhileLoopTree tree,
Void p) |
Node |
visitWildcard(WildcardTree tree,
Void p) |
Node |
visitYield17(Tree yieldTree,
Void p)
Visit a SwitchExpressionTree.
|
protected Node |
widen(Node node,
TypeMirror destType)
Perform widening primitive conversion on the input node to make it match the destination type.
|
protected Tree.Kind |
withoutAssignment(Tree.Kind kind)
Map an operation with assignment to the corresponding operation without assignment.
|
reduce, scan, visitExports, visitIntersectionType, visitModule, visitOpens, visitPackage, visitProvides, visitRequires, visitUses
protected final Elements elements
public final TreeBuilder treeBuilder
protected long uid
protected VariableTree ea
VariableTree
that indicates whether assertions are enabled or not.public CFGTranslationPhaseOne(TreeBuilder treeBuilder, AnnotationProvider annotationProvider, boolean assumeAssertionsEnabled, boolean assumeAssertionsDisabled, ProcessingEnvironment env)
treeBuilder
- builder for new AST nodesannotationProvider
- extracts annotations from AST nodesassumeAssertionsDisabled
- can assertions be assumed to be disabled?assumeAssertionsEnabled
- can assertions be assumed to be enabled?env
- annotation processing environment containing type utilitiespublic PhaseOneResult process(TreePath bodyPath, UnderlyingAST underlyingAST)
bodyPath
- path to the body of the underlying AST's methodunderlyingAST
- the AST for which the CFG is to be builtpublic PhaseOneResult process(CompilationUnitTree root, UnderlyingAST underlyingAST)
root
. This method does not process the entire given
CompilationUnitTree. Rather, it processes one body (of a method/lambda/etc.) within it, which
corresponds to underlyingAST
.root
- the compilation unitunderlyingAST
- the AST corresponding to the body to processpublic void handleArtificialTree(Tree tree)
tree
- the newly created Treeprotected ProcessingEnvironment getProcessingEnvironment()
public TreePath getCurrentPath()
public Node visitYield17(Tree yieldTree, Void p)
yieldTree
- a YieldTree, typed as Tree to be backward-compatiblep
- parameterpublic Node visitSwitchExpression17(Tree switchExpressionTree, Void p)
switchExpressionTree
- a SwitchExpressionTree, typed as Tree to be backward-compatiblep
- parameterpublic Node visitBindingPattern17(Tree bindingPatternTree, Void p)
bindingPatternTree
- a BindingPatternTree, typed as Tree to be backward-compatiblep
- parameterprotected void addToLookupMap(Node node)
node
- the node to add to the lookup mapprotected void addToConvertedLookupMap(Node node)
node
- the node to add to the lookup mapprotected void addToConvertedLookupMap(Tree tree, Node node)
tree
- the tree used as a key in the mapnode
- the node to add to the lookup mapprotected void extendWithNode(Node node)
node
- the node to addprotected org.checkerframework.dataflow.cfg.builder.NodeWithExceptionsHolder extendWithNodeWithException(Node node, TypeMirror cause)
node
might throw the exception
cause
.node
- the node to addcause
- an exception that the node might throwprotected org.checkerframework.dataflow.cfg.builder.NodeWithExceptionsHolder extendWithNodeWithExceptions(Node node, Set<TypeMirror> causes)
node
might throw any of the
exceptions in causes
.node
- the node to addcauses
- set of exceptions that the node might throwprotected org.checkerframework.dataflow.cfg.builder.NodeWithExceptionsHolder extendWithClassNameNode(ClassNameNode node)
Evaluating a class literal kicks off class loading (JLS 15.8.2) which can fail and throw one of the specified subclasses of a LinkageError or an OutOfMemoryError (JLS 12.2.1).
node
- the ClassName node to addprotected <T extends Node> T insertNodeAfter(T node, Node pred)
node
after pred
in the list of extended nodes, or append to the list if
pred
is not present.node
- the node to addpred
- the desired predecessor of nodeprotected org.checkerframework.dataflow.cfg.builder.NodeWithExceptionsHolder insertNodeWithExceptionsAfter(Node node, Set<TypeMirror> causes, Node pred)
node
that might throw the exceptions in causes
after pred
in
the list of extended nodes, or append to the list if pred
is not present.node
- the node to addcauses
- set of exceptions that the node might throwpred
- the desired predecessor of nodeprotected void extendWithExtendedNode(ExtendedNode n)
n
- the extended nodeprotected void insertExtendedNodeAfter(ExtendedNode n, @FindDistinct Node pred)
n
after the node pred
in the list of extended nodes, or append n
if pred
is not present.n
- the extended nodepred
- the desired predecessorprotected void addLabelForNextNode(Label l)
l
to the extended node that will be placed next in the sequence.l
- the node to add to the forthcoming extended nodeprotected String uniqueName(String prefix)
prefix
.prefix
- the prefix of the unique nameprefix
protected Node box(Node node)
node
- in input nodeprotected Node unbox(Node node)
node
- in input nodeprotected Node stringConversion(Node node)
node
- an input nodeprotected Node unaryNumericPromotion(Node node)
node
- a node producing a value of numeric primitive or boxed typeprotected boolean isNumericOrBoxed(TypeMirror type)
protected TypeMirror binaryPromotedType(TypeMirror left, TypeMirror right)
left
- the type of the left operandright
- the type of the right operandprotected Node binaryNumericPromotion(Node node, TypeMirror exprType)
node
- a node producing a value of numeric primitive or boxed typeexprType
- the type to promote the value toprotected Node widen(Node node, TypeMirror destType)
node
- a node producing a value of numeric primitive typedestType
- the type to widen the value toprotected Node narrow(Node node, TypeMirror destType)
node
- a node producing a value of numeric primitive typedestType
- the type to narrow the value toprotected Node narrowAndBox(Node node, TypeMirror destType)
node
- a node producing a value of numeric primitive typedestType
- the type to narrow the value to (possibly boxed)protected boolean conversionRequiresNarrowing(TypeMirror varType, Node node)
varType
- the type of a variable (or general LHS) to be converted tonode
- a node whose value is being convertedprotected Node commonConvert(Node node, TypeMirror varType, boolean contextAllowsNarrowing)
node
- a Node producing a valuevarType
- the type of a variablecontextAllowsNarrowing
- whether to allow narrowing (for assignment conversion) or not
(for method invocation conversion)protected Node assignConvert(Node node, TypeMirror varType)
node
- a Node producing a valuevarType
- the type of a variableprotected Node methodInvocationConvert(Node node, TypeMirror formalType)
node
- a Node producing a valueformalType
- the type of a formal parameterprotected List<Node> convertCallArguments(ExecutableElement method, List<? extends ExpressionTree> actualExprs)
Node
s
representing the arguments converted for a call of the method. This method applies to both
method invocations and constructor calls.method
- an ExecutableElement representing a method to be calledactualExprs
- a List of argument expressions to a callNode
s representing arguments after conversions required by a call to
this methodprotected Node conditionalExprPromotion(Node node, TypeMirror destType)
node
- a node occurring as the second or third operand of a conditional expressiondestType
- the type to promote the value toprotected @Nullable Name getLabel(TreePath path)
Name
of the leaf in the argument path, or null if the leaf is not a
labeled statement.public Node visitAnnotatedType(AnnotatedTypeTree tree, Void p)
visitAnnotatedType
in interface TreeVisitor<Node,Void>
visitAnnotatedType
in class TreeScanner<Node,Void>
public Node visitAnnotation(AnnotationTree tree, Void p)
visitAnnotation
in interface TreeVisitor<Node,Void>
visitAnnotation
in class TreeScanner<Node,Void>
public MethodInvocationNode visitMethodInvocation(MethodInvocationTree tree, Void p)
visitMethodInvocation
in interface TreeVisitor<Node,Void>
visitMethodInvocation
in class TreeScanner<Node,Void>
public Node visitAssert(AssertTree tree, Void p)
visitAssert
in interface TreeVisitor<Node,Void>
visitAssert
in class TreeScanner<Node,Void>
protected boolean assumeAssertionsEnabledFor(AssertTree tree)
AssertTree
? False by default.protected VariableTree getAssertionsEnabledVariable()
VariableTree
that indicates whether assertions are enabled or not.protected void translateAssertWithAssertionsEnabled(AssertTree tree)
public Node visitAssignment(AssignmentTree tree, Void p)
visitAssignment
in interface TreeVisitor<Node,Void>
visitAssignment
in class TreeScanner<Node,Void>
protected AssignmentNode translateAssignment(Tree tree, Node target, ExpressionTree rhs)
protected AssignmentNode translateAssignment(Tree tree, Node target, Node expression)
protected Tree.Kind withoutAssignment(Tree.Kind kind)
kind
- a Tree.Kind representing an operation with assignmentpublic Node visitCompoundAssignment(CompoundAssignmentTree tree, Void p)
visitCompoundAssignment
in interface TreeVisitor<Node,Void>
visitCompoundAssignment
in class TreeScanner<Node,Void>
public Node visitBinary(BinaryTree tree, Void p)
visitBinary
in interface TreeVisitor<Node,Void>
visitBinary
in class TreeScanner<Node,Void>
public Node visitBlock(BlockTree tree, Void p)
visitBlock
in interface TreeVisitor<Node,Void>
visitBlock
in class TreeScanner<Node,Void>
public Node visitBreak(BreakTree tree, Void p)
visitBreak
in interface TreeVisitor<Node,Void>
visitBreak
in class TreeScanner<Node,Void>
public Node visitSwitch(SwitchTree tree, Void p)
visitSwitch
in interface TreeVisitor<Node,Void>
visitSwitch
in class TreeScanner<Node,Void>
public Node visitCase(CaseTree tree, Void p)
visitCase
in interface TreeVisitor<Node,Void>
visitCase
in class TreeScanner<Node,Void>
public Node visitCatch(CatchTree tree, Void p)
visitCatch
in interface TreeVisitor<Node,Void>
visitCatch
in class TreeScanner<Node,Void>
public Node visitClass(ClassTree tree, Void p)
visitClass
in interface TreeVisitor<Node,Void>
visitClass
in class TreeScanner<Node,Void>
public Node visitConditionalExpression(ConditionalExpressionTree tree, Void p)
visitConditionalExpression
in interface TreeVisitor<Node,Void>
visitConditionalExpression
in class TreeScanner<Node,Void>
public Node visitContinue(ContinueTree tree, Void p)
visitContinue
in interface TreeVisitor<Node,Void>
visitContinue
in class TreeScanner<Node,Void>
public Node visitDoWhileLoop(DoWhileLoopTree tree, Void p)
visitDoWhileLoop
in interface TreeVisitor<Node,Void>
visitDoWhileLoop
in class TreeScanner<Node,Void>
public Node visitErroneous(ErroneousTree tree, Void p)
visitErroneous
in interface TreeVisitor<Node,Void>
visitErroneous
in class TreeScanner<Node,Void>
public Node visitExpressionStatement(ExpressionStatementTree tree, Void p)
visitExpressionStatement
in interface TreeVisitor<Node,Void>
visitExpressionStatement
in class TreeScanner<Node,Void>
public Node visitEnhancedForLoop(EnhancedForLoopTree tree, Void p)
visitEnhancedForLoop
in interface TreeVisitor<Node,Void>
visitEnhancedForLoop
in class TreeScanner<Node,Void>
protected VariableTree createEnhancedForLoopIteratorVariable(MethodInvocationTree iteratorCall, VariableElement variableElement)
protected VariableTree createEnhancedForLoopArrayVariable(ExpressionTree expression, VariableElement variableElement)
public Node visitForLoop(ForLoopTree tree, Void p)
visitForLoop
in interface TreeVisitor<Node,Void>
visitForLoop
in class TreeScanner<Node,Void>
public Node visitIdentifier(IdentifierTree tree, Void p)
visitIdentifier
in interface TreeVisitor<Node,Void>
visitIdentifier
in class TreeScanner<Node,Void>
public Node visitIf(IfTree tree, Void p)
visitIf
in interface TreeVisitor<Node,Void>
visitIf
in class TreeScanner<Node,Void>
public Node visitImport(ImportTree tree, Void p)
visitImport
in interface TreeVisitor<Node,Void>
visitImport
in class TreeScanner<Node,Void>
public Node visitArrayAccess(ArrayAccessTree tree, Void p)
visitArrayAccess
in interface TreeVisitor<Node,Void>
visitArrayAccess
in class TreeScanner<Node,Void>
public Node visitLabeledStatement(LabeledStatementTree tree, Void p)
visitLabeledStatement
in interface TreeVisitor<Node,Void>
visitLabeledStatement
in class TreeScanner<Node,Void>
public Node visitLiteral(LiteralTree tree, Void p)
visitLiteral
in interface TreeVisitor<Node,Void>
visitLiteral
in class TreeScanner<Node,Void>
public Node visitMethod(MethodTree tree, Void p)
visitMethod
in interface TreeVisitor<Node,Void>
visitMethod
in class TreeScanner<Node,Void>
public Node visitModifiers(ModifiersTree tree, Void p)
visitModifiers
in interface TreeVisitor<Node,Void>
visitModifiers
in class TreeScanner<Node,Void>
public Node visitNewArray(NewArrayTree tree, Void p)
visitNewArray
in interface TreeVisitor<Node,Void>
visitNewArray
in class TreeScanner<Node,Void>
public Node visitNewClass(NewClassTree tree, Void p)
visitNewClass
in interface TreeVisitor<Node,Void>
visitNewClass
in class TreeScanner<Node,Void>
public Node visitParenthesized(ParenthesizedTree tree, Void p)
visitParenthesized
in interface TreeVisitor<Node,Void>
visitParenthesized
in class TreeScanner<Node,Void>
public Node visitReturn(ReturnTree tree, Void p)
visitReturn
in interface TreeVisitor<Node,Void>
visitReturn
in class TreeScanner<Node,Void>
public Node visitMemberSelect(MemberSelectTree tree, Void p)
visitMemberSelect
in interface TreeVisitor<Node,Void>
visitMemberSelect
in class TreeScanner<Node,Void>
public Node visitEmptyStatement(EmptyStatementTree tree, Void p)
visitEmptyStatement
in interface TreeVisitor<Node,Void>
visitEmptyStatement
in class TreeScanner<Node,Void>
public Node visitSynchronized(SynchronizedTree tree, Void p)
visitSynchronized
in interface TreeVisitor<Node,Void>
visitSynchronized
in class TreeScanner<Node,Void>
public Node visitThrow(ThrowTree tree, Void p)
visitThrow
in interface TreeVisitor<Node,Void>
visitThrow
in class TreeScanner<Node,Void>
public Node visitCompilationUnit(CompilationUnitTree tree, Void p)
visitCompilationUnit
in interface TreeVisitor<Node,Void>
visitCompilationUnit
in class TreeScanner<Node,Void>
public Node visitTry(TryTree tree, Void p)
visitTry
in interface TreeVisitor<Node,Void>
visitTry
in class TreeScanner<Node,Void>
public Node visitParameterizedType(ParameterizedTypeTree tree, Void p)
visitParameterizedType
in interface TreeVisitor<Node,Void>
visitParameterizedType
in class TreeScanner<Node,Void>
public Node visitUnionType(UnionTypeTree tree, Void p)
visitUnionType
in interface TreeVisitor<Node,Void>
visitUnionType
in class TreeScanner<Node,Void>
public Node visitArrayType(ArrayTypeTree tree, Void p)
visitArrayType
in interface TreeVisitor<Node,Void>
visitArrayType
in class TreeScanner<Node,Void>
public Node visitTypeCast(TypeCastTree tree, Void p)
visitTypeCast
in interface TreeVisitor<Node,Void>
visitTypeCast
in class TreeScanner<Node,Void>
public Node visitPrimitiveType(PrimitiveTypeTree tree, Void p)
visitPrimitiveType
in interface TreeVisitor<Node,Void>
visitPrimitiveType
in class TreeScanner<Node,Void>
public Node visitTypeParameter(TypeParameterTree tree, Void p)
visitTypeParameter
in interface TreeVisitor<Node,Void>
visitTypeParameter
in class TreeScanner<Node,Void>
public Node visitInstanceOf(InstanceOfTree tree, Void p)
visitInstanceOf
in interface TreeVisitor<Node,Void>
visitInstanceOf
in class TreeScanner<Node,Void>
public Node visitUnary(UnaryTree tree, Void p)
visitUnary
in interface TreeVisitor<Node,Void>
visitUnary
in class TreeScanner<Node,Void>
public Node visitVariable(VariableTree tree, Void p)
visitVariable
in interface TreeVisitor<Node,Void>
visitVariable
in class TreeScanner<Node,Void>
public Node visitWhileLoop(WhileLoopTree tree, Void p)
visitWhileLoop
in interface TreeVisitor<Node,Void>
visitWhileLoop
in class TreeScanner<Node,Void>
public Node visitLambdaExpression(LambdaExpressionTree tree, Void p)
visitLambdaExpression
in interface TreeVisitor<Node,Void>
visitLambdaExpression
in class TreeScanner<Node,Void>
public Node visitMemberReference(MemberReferenceTree tree, Void p)
visitMemberReference
in interface TreeVisitor<Node,Void>
visitMemberReference
in class TreeScanner<Node,Void>
public Node visitWildcard(WildcardTree tree, Void p)
visitWildcard
in interface TreeVisitor<Node,Void>
visitWildcard
in class TreeScanner<Node,Void>
public Node visitOther(Tree tree, Void p)
visitOther
in interface TreeVisitor<Node,Void>
visitOther
in class TreeScanner<Node,Void>
protected TypeMirror getTypeMirror(Class<?> clazz)
clazz
- a classprotected @Nullable TypeMirror maybeGetTypeMirror(Class<?> clazz)
null
if the type is not present.
This can be used to handle system types that are not present. For example, in Java code that is translated to JavaScript using j2cl, the custom bootclasspath contains APIs that are emulated in JavaScript, so some types such as OutOfMemoryError are deliberately not present.
clazz
- a class, which must have a canonical namenull
if the type is not present