java.lang.Object
com.sun.source.util.TreeScanner<R,P>
- Type Parameters:
R
- the return type of this visitor's methods. UseVoid
for visitors that do not need to return results.P
- the type of the additional parameter to this visitor's methods. UseVoid
for visitors that do not need an additional parameter.
- All Implemented Interfaces:
TreeVisitor<R,
P>
- Direct Known Subclasses:
TreePathScanner
A TreeVisitor that visits all the child tree nodes.
To visit nodes of a particular type, just override the
corresponding visitXYZ method.
Inside your method, call super.visitXYZ to visit descendant
nodes.
Here is an example to count the number of identifier nodes in a tree:
class CountIdentifiers extends TreeScanner<Integer,Void> { @Override public Integer visitIdentifier(IdentifierTree node, Void p) { return 1; } @Override public Integer reduce(Integer r1, Integer r2) { return (r1 == null ? 0 : r1) + (r2 == null ? 0 : r2); } }
- Implementation Requirements:
The default implementation of the visitXYZ methods will determine a result as follows:
- If the node being visited has no children, the result will be
null
. - If the node being visited has one child, the result will be the
result of calling
scan
with that child. The child may be a simple node or itself a list of nodes. - If the node being visited has more than one child, the result will
be determined by calling
scan
with each child in turn, and then combining the result of each scan after the first with the cumulative result so far, as determined by thereduce(R, R)
method. Each child may be either a simple node or a list of nodes. The default behavior of thereduce
method is such that the result of the visitXYZ method will be the result of the last child scanned.
- If the node being visited has no children, the result will be
- Since:
- 1.6
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReduces two results into a combined result.Scans a single node.Scans a sequence of nodes.visitAnnotatedType
(AnnotatedTypeTree node, P p) Visits anAnnotatedTypeTree
node.visitAnnotation
(AnnotationTree node, P p) Visits anAnnotatedTree
node.visitArrayAccess
(ArrayAccessTree node, P p) Visits anArrayAccessTree
node.visitArrayType
(ArrayTypeTree node, P p) Visits anArrayTypeTree
node.visitAssert
(AssertTree node, P p) Visits anAssertTree
node.visitAssignment
(AssignmentTree node, P p) Visits anAssignmentTree
node.visitBinary
(BinaryTree node, P p) Visits aBinaryTree
node.visitBindingPattern
(BindingPatternTree node, P p) Visits aBindingPatternTree
node.visitBlock
(BlockTree node, P p) Visits aBlockTree
node.visitBreak
(BreakTree node, P p) Visits aBreakTree
node.Visits aCaseTree
node.visitCatch
(CatchTree node, P p) Visits aCatchTree
node.visitClass
(ClassTree node, P p) Visits aClassTree
node.visitCompilationUnit
(CompilationUnitTree node, P p) Visits aCompilationUnitTree
node.Visits aCompoundAssignmentTree
node.Visits aConditionalExpressionTree
node.Preview.Visits aConstantCaseLabelTree
node.visitContinue
(ContinueTree node, P p) Visits aContinueTree
node.Preview.Visits aDeconstructionPatternTree
node.Preview.Visits aDefaultCaseLabelTree
node.visitDoWhileLoop
(DoWhileLoopTree node, P p) Visits aDoWhileTree
node.visitEmptyStatement
(EmptyStatementTree node, P p) Visits anEmptyStatementTree
node.visitEnhancedForLoop
(EnhancedForLoopTree node, P p) Visits anEnhancedForLoopTree
node.visitErroneous
(ErroneousTree node, P p) Visits anErroneousTree
node.visitExports
(ExportsTree node, P p) Visits anExportsTree
node.Visits anExpressionStatementTree
node.visitForLoop
(ForLoopTree node, P p) Visits aForLoopTree
node.visitIdentifier
(IdentifierTree node, P p) Visits anIdentifierTree
node.Visits anIfTree
node.visitImport
(ImportTree node, P p) Visits anImportTree
node.visitInstanceOf
(InstanceOfTree node, P p) Visits anInstanceOfTree
node.visitIntersectionType
(IntersectionTypeTree node, P p) Visits anIntersectionTypeTree
node.visitLabeledStatement
(LabeledStatementTree node, P p) Visits aLabeledStatementTree
node.visitLambdaExpression
(LambdaExpressionTree node, P p) Visits aLambdaExpressionTree
node.visitLiteral
(LiteralTree node, P p) Visits aLiteralTree
node.visitMemberReference
(MemberReferenceTree node, P p) Visits aMemberReferenceTree
node.visitMemberSelect
(MemberSelectTree node, P p) Visits aMemberSelectTree
node.visitMethod
(MethodTree node, P p) Visits aMethodTree
node.visitMethodInvocation
(MethodInvocationTree node, P p) Visits aMethodInvocationTree
node.visitModifiers
(ModifiersTree node, P p) Visits aModifiersTree
node.visitModule
(ModuleTree node, P p) Visits aModuleTree
node.visitNewArray
(NewArrayTree node, P p) Visits aNewArrayTree
node.visitNewClass
(NewClassTree node, P p) Visits aNewClassTree
node.visitOpens
(OpensTree node, P p) Visits anOpensTree
node.visitOther
(Tree node, P p) Visits an unknown type ofTree
node.visitPackage
(PackageTree node, P p) Visits aPackageTree
node.visitParameterizedType
(ParameterizedTypeTree node, P p) Visits aParameterizedTypeTree
node.visitParenthesized
(ParenthesizedTree node, P p) Visits aParenthesizedTree
node.Preview.Visits aParenthesizedPatternTree
node.Preview.Visits aPatternCaseLabelTree
node.visitPrimitiveType
(PrimitiveTypeTree node, P p) Visits aPrimitiveTypeTree
node.visitProvides
(ProvidesTree node, P p) Visits aProvidesTree
node.visitRequires
(RequiresTree node, P p) Visits aRequiresTree
node.visitReturn
(ReturnTree node, P p) Visits aReturnTree
node.visitSwitch
(SwitchTree node, P p) Visits aSwitchTree
node.visitSwitchExpression
(SwitchExpressionTree node, P p) Visits aSwitchExpressionTree
node.visitSynchronized
(SynchronizedTree node, P p) Visits aSynchronizedTree
node.visitThrow
(ThrowTree node, P p) Visits aThrowTree
node.Visits aTryTree
node.visitTypeCast
(TypeCastTree node, P p) Visits aTypeCastTree
node.visitTypeParameter
(TypeParameterTree node, P p) Visits aTypeParameterTree
node.visitUnary
(UnaryTree node, P p) Visits aUnaryTree
node.visitUnionType
(UnionTypeTree node, P p) Visits aUnionTypeTree
node.Visits aUsesTree
node.visitVariable
(VariableTree node, P p) Visits aVariableTree
node.visitWhileLoop
(WhileLoopTree node, P p) Visits aWhileLoopTree
node.visitWildcard
(WildcardTree node, P p) Visits aWildcardTypeTree
node.visitYield
(YieldTree node, P p) Visits aYieldTree
node.
-
Constructor Details
-
TreeScanner
public TreeScanner()Constructs aTreeScanner
.
-
-
Method Details
-
scan
Scans a single node.- Parameters:
tree
- the node to be scannedp
- a parameter value passed to the visit method- Returns:
- the result value from the visit method
-
scan
Scans a sequence of nodes.- Parameters:
nodes
- the nodes to be scannedp
- a parameter value to be passed to the visit method for each node- Returns:
- the combined return value from the visit methods.
The values are combined using the
reduce
method.
-
reduce
Reduces two results into a combined result. The default implementation is to return the first parameter. The general contract of the method is that it may take any action whatsoever.- Parameters:
r1
- the first of the values to be combinedr2
- the second of the values to be combined- Returns:
- the result of combining the two parameters
-
visitCompilationUnit
Visits aCompilationUnitTree
node.- Specified by:
visitCompilationUnit
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitPackage
Visits aPackageTree
node.- Specified by:
visitPackage
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitImport
Visits anImportTree
node.- Specified by:
visitImport
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitClass
Visits aClassTree
node.- Specified by:
visitClass
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitMethod
Visits aMethodTree
node.- Specified by:
visitMethod
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitVariable
Visits aVariableTree
node.- Specified by:
visitVariable
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitEmptyStatement
Visits anEmptyStatementTree
node.- Specified by:
visitEmptyStatement
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation returns
null
. - Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitBlock
Visits aBlockTree
node.- Specified by:
visitBlock
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitDoWhileLoop
Visits aDoWhileTree
node.- Specified by:
visitDoWhileLoop
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitWhileLoop
Visits aWhileLoopTree
node.- Specified by:
visitWhileLoop
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitForLoop
Visits aForLoopTree
node.- Specified by:
visitForLoop
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitEnhancedForLoop
Visits anEnhancedForLoopTree
node.- Specified by:
visitEnhancedForLoop
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitLabeledStatement
Visits aLabeledStatementTree
node.- Specified by:
visitLabeledStatement
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitSwitch
Visits aSwitchTree
node.- Specified by:
visitSwitch
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitSwitchExpression
Visits aSwitchExpressionTree
node.- Specified by:
visitSwitchExpression
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitCase
Visits aCaseTree
node.- Specified by:
visitCase
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitSynchronized
Visits aSynchronizedTree
node.- Specified by:
visitSynchronized
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitTry
Visits aTryTree
node.- Specified by:
visitTry
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitCatch
Visits aCatchTree
node.- Specified by:
visitCatch
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitConditionalExpression
Visits aConditionalExpressionTree
node.- Specified by:
visitConditionalExpression
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitIf
Visits anIfTree
node.- Specified by:
visitIf
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitExpressionStatement
Visits anExpressionStatementTree
node.- Specified by:
visitExpressionStatement
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitBreak
Visits aBreakTree
node.- Specified by:
visitBreak
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation returns
null
. - Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitContinue
Visits aContinueTree
node.- Specified by:
visitContinue
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation returns
null
. - Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitReturn
Visits aReturnTree
node.- Specified by:
visitReturn
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitThrow
Visits aThrowTree
node.- Specified by:
visitThrow
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitAssert
Visits anAssertTree
node.- Specified by:
visitAssert
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitMethodInvocation
Visits aMethodInvocationTree
node.- Specified by:
visitMethodInvocation
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitNewClass
Visits aNewClassTree
node.- Specified by:
visitNewClass
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitNewArray
Visits aNewArrayTree
node.- Specified by:
visitNewArray
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitLambdaExpression
Visits aLambdaExpressionTree
node.- Specified by:
visitLambdaExpression
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitParenthesized
Visits aParenthesizedTree
node.- Specified by:
visitParenthesized
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitAssignment
Visits anAssignmentTree
node.- Specified by:
visitAssignment
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitCompoundAssignment
Visits aCompoundAssignmentTree
node.- Specified by:
visitCompoundAssignment
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitUnary
Visits aUnaryTree
node.- Specified by:
visitUnary
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitBinary
Visits aBinaryTree
node.- Specified by:
visitBinary
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitTypeCast
Visits aTypeCastTree
node.- Specified by:
visitTypeCast
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitInstanceOf
Visits anInstanceOfTree
node.- Specified by:
visitInstanceOf
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitBindingPattern
Visits aBindingPatternTree
node.- Specified by:
visitBindingPattern
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
- Since:
- 14
-
visitDefaultCaseLabel
visitDefaultCaseLabel
is a reflective preview API of the Java platform.Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.Visits aDefaultCaseLabelTree
node.- Specified by:
visitDefaultCaseLabel
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation returns
null
. - Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
- Since:
- 17
-
visitConstantCaseLabel
visitConstantCaseLabel
is a reflective preview API of the Java platform.Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.Visits aConstantCaseLabelTree
node.- Specified by:
visitConstantCaseLabel
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation returns
null
. - Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
- Since:
- 19
-
visitPatternCaseLabel
visitPatternCaseLabel
is a reflective preview API of the Java platform.Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.Visits aPatternCaseLabelTree
node.- Specified by:
visitPatternCaseLabel
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation returns
null
. - Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
- Since:
- 19
-
visitDeconstructionPattern
visitDeconstructionPattern
is a reflective preview API of the Java platform.Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.Visits aDeconstructionPatternTree
node.- Specified by:
visitDeconstructionPattern
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
- Since:
- 19
-
visitArrayAccess
Visits anArrayAccessTree
node. This implementation scans the children in left to right order.- Specified by:
visitArrayAccess
in interfaceTreeVisitor<R,
P> - Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitMemberSelect
Visits aMemberSelectTree
node.- Specified by:
visitMemberSelect
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitParenthesizedPattern
visitParenthesizedPattern
is a reflective preview API of the Java platform.Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.Visits aParenthesizedPatternTree
node.- Specified by:
visitParenthesizedPattern
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
- Since:
- 17
-
visitMemberReference
Visits aMemberReferenceTree
node.- Specified by:
visitMemberReference
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitIdentifier
Visits anIdentifierTree
node.- Specified by:
visitIdentifier
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation returns
null
. - Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitLiteral
Visits aLiteralTree
node.- Specified by:
visitLiteral
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation returns
null
. - Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitPrimitiveType
Visits aPrimitiveTypeTree
node.- Specified by:
visitPrimitiveType
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation returns
null
. - Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitArrayType
Visits anArrayTypeTree
node.- Specified by:
visitArrayType
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitParameterizedType
Visits aParameterizedTypeTree
node.- Specified by:
visitParameterizedType
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitUnionType
Visits aUnionTypeTree
node.- Specified by:
visitUnionType
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitIntersectionType
Visits anIntersectionTypeTree
node.- Specified by:
visitIntersectionType
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitTypeParameter
Visits aTypeParameterTree
node.- Specified by:
visitTypeParameter
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitWildcard
Visits aWildcardTypeTree
node.- Specified by:
visitWildcard
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitModifiers
Visits aModifiersTree
node.- Specified by:
visitModifiers
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitAnnotation
Visits anAnnotatedTree
node.- Specified by:
visitAnnotation
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitAnnotatedType
Visits anAnnotatedTypeTree
node.- Specified by:
visitAnnotatedType
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitModule
Visits aModuleTree
node.- Specified by:
visitModule
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitExports
Visits anExportsTree
node.- Specified by:
visitExports
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitOpens
Visits anOpensTree
node.- Specified by:
visitOpens
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitProvides
Visits aProvidesTree
node.- Specified by:
visitProvides
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitRequires
Visits aRequiresTree
node.- Specified by:
visitRequires
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitUses
Visits aUsesTree
node.- Specified by:
visitUses
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitOther
Visits an unknown type ofTree
node. This can occur if the language evolves and new kinds of nodes are added to theTree
hierarchy.- Specified by:
visitOther
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation returns
null
. - Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitErroneous
Visits anErroneousTree
node.- Specified by:
visitErroneous
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation returns
null
. - Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-
visitYield
Visits aYieldTree
node.- Specified by:
visitYield
in interfaceTreeVisitor<R,
P> - Implementation Requirements:
- This implementation scans the children in left to right order.
- Parameters:
node
- the node being visitedp
- a parameter value- Returns:
- the result of scanning
-