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.visitAnyPattern
(AnyPatternTree node, P p) Visits aAnyPatternTree
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.visitConstantCaseLabel
(ConstantCaseLabelTree node, P p) Visits aConstantCaseLabelTree
node.visitContinue
(ContinueTree node, P p) Visits aContinueTree
node.Visits aDeconstructionPatternTree
node.visitDefaultCaseLabel
(DefaultCaseLabelTree node, P p) 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.visitPatternCaseLabel
(PatternCaseLabelTree node, P p) 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.Preview.Visits a StringTemplateTree 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
-
scan
-
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
-
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
-
visitAnyPattern
Visits aAnyPatternTree
node.- Specified by:
visitAnyPattern
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:
- 21
-
visitStringTemplate
visitStringTemplate
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 a StringTemplateTree node.- Specified by:
visitStringTemplate
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:
- 21
-
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
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:
- 21
-
visitConstantCaseLabel
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:
- 21
-
visitPatternCaseLabel
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:
- 21
-
visitDeconstructionPattern
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:
- 21
-
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
-
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
-