java.lang.Object
com.sun.source.util.TreeScanner<R,P>
- Type Parameters:
R- the return type of this visitor's methods. UseVoidfor visitors that do not need to return results.P- the type of the additional parameter to this visitor's methods. UseVoidfor visitors that do not need an additional parameter.
- All Implemented Interfaces:
TreeVisitor<R,P>
- Direct Known Subclasses:
TreePathScanner
TreeScanner relies on preview features of the Java platform:
TreeScannerrefers to one or more reflective preview APIs:DefaultCaseLabelTree,GuardedPatternTree,ParenthesizedPatternTree.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
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
scanwith 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
scanwith 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 thereducemethod 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
Constructors -
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 an AnnotatedTypeTree node.visitAnnotation(AnnotationTree node, P p) Visits an AnnotatedTree node.visitArrayAccess(ArrayAccessTree node, P p) Visits an ArrayAccessTree node.visitArrayType(ArrayTypeTree node, P p) Visits an ArrayTypeTree node.visitAssert(AssertTree node, P p) Visits an AssertTree node.visitAssignment(AssignmentTree node, P p) Visits an AssignmentTree node.visitBinary(BinaryTree node, P p) Visits a BinaryTree node.visitBindingPattern(BindingPatternTree node, P p) Visits an BindingPattern node.visitBlock(BlockTree node, P p) Visits a BlockTree node.visitBreak(BreakTree node, P p) Visits a BreakTree node.Visits a CaseTree node.visitCatch(CatchTree node, P p) Visits a CatchTree node.visitClass(ClassTree node, P p) Visits a ClassTree node.visitCompilationUnit(CompilationUnitTree node, P p) Visits a CompilationUnitTree node.Visits a CompoundAssignmentTree node.Visits a ConditionalExpressionTree node.visitContinue(ContinueTree node, P p) Visits a ContinueTree node.Preview.Visits a DefaultCaseLabelTree node.visitDoWhileLoop(DoWhileLoopTree node, P p) Visits a DoWhileTree node.visitEmptyStatement(EmptyStatementTree node, P p) Visits an EmptyStatementTree node.visitEnhancedForLoop(EnhancedForLoopTree node, P p) Visits an EnhancedForLoopTree node.visitErroneous(ErroneousTree node, P p) Visits an ErroneousTree node.visitExports(ExportsTree node, P p) Visits an ExportsTree node.Visits an ExpressionStatementTree node.visitForLoop(ForLoopTree node, P p) Visits a ForLoopTree node.Preview.Visits a GuardPatternTree node.visitIdentifier(IdentifierTree node, P p) Visits an IdentifierTree node.Visits an IfTree node.visitImport(ImportTree node, P p) Visits an ImportTree node.visitInstanceOf(InstanceOfTree node, P p) Visits an InstanceOfTree node.visitIntersectionType(IntersectionTypeTree node, P p) Visits an IntersectionTypeTree node.visitLabeledStatement(LabeledStatementTree node, P p) Visits a LabeledStatementTree node.visitLambdaExpression(LambdaExpressionTree node, P p) Visits a LambdaExpressionTree node.visitLiteral(LiteralTree node, P p) Visits a LiteralTree node.visitMemberReference(MemberReferenceTree node, P p) Visits a MemberReferenceTree node.visitMemberSelect(MemberSelectTree node, P p) Visits a MemberSelectTree node.visitMethod(MethodTree node, P p) Visits a MethodTree node.visitMethodInvocation(MethodInvocationTree node, P p) Visits a MethodInvocationTree node.visitModifiers(ModifiersTree node, P p) Visits a ModifiersTree node.visitModule(ModuleTree node, P p) Visits a ModuleTree node.visitNewArray(NewArrayTree node, P p) Visits a NewArrayTree node.visitNewClass(NewClassTree node, P p) Visits a NewClassTree node.visitOpens(OpensTree node, P p) Visits an OpensTree node.visitOther(Tree node, P p) Visits an unknown type of Tree node.visitPackage(PackageTree node, P p) Visits a PackageTree node.visitParameterizedType(ParameterizedTypeTree node, P p) Visits a ParameterizedTypeTree node.visitParenthesized(ParenthesizedTree node, P p) Visits a ParenthesizedTree node.Preview.Visits a ParenthesizedPatternTree node.visitPrimitiveType(PrimitiveTypeTree node, P p) Visits a PrimitiveTypeTree node.visitProvides(ProvidesTree node, P p) Visits a ProvidesTree node.visitRequires(RequiresTree node, P p) Visits a RequiresTree node.visitReturn(ReturnTree node, P p) Visits a ReturnTree node.visitSwitch(SwitchTree node, P p) Visits a SwitchTree node.visitSwitchExpression(SwitchExpressionTree node, P p) Visits a SwitchExpressionTree node.visitSynchronized(SynchronizedTree node, P p) Visits a SynchronizedTree node.visitThrow(ThrowTree node, P p) Visits a ThrowTree node.Visits a TryTree node.visitTypeCast(TypeCastTree node, P p) Visits a TypeCastTree node.visitTypeParameter(TypeParameterTree node, P p) Visits a TypeParameterTree node.visitUnary(UnaryTree node, P p) Visits a UnaryTree node.visitUnionType(UnionTypeTree node, P p) Visits a UnionTypeTree node.Visits a UsesTree node.visitVariable(VariableTree node, P p) Visits a VariableTree node.visitWhileLoop(WhileLoopTree node, P p) Visits a WhileLoopTree node.visitWildcard(WildcardTree node, P p) Visits a WildcardTypeTree node.visitYield(YieldTree node, P p) Visits a YieldTree 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
reducemethod.
-
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 a CompilationUnitTree node.- Specified by:
visitCompilationUnitin 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 a PackageTree node.- Specified by:
visitPackagein 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 an ImportTree node.- Specified by:
visitImportin 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 a ClassTree node.- Specified by:
visitClassin 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 a MethodTree node.- Specified by:
visitMethodin 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 a VariableTree node.- Specified by:
visitVariablein 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 an EmptyStatementTree node.- Specified by:
visitEmptyStatementin 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 a BlockTree node.- Specified by:
visitBlockin 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 a DoWhileTree node.- Specified by:
visitDoWhileLoopin 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 a WhileLoopTree node.- Specified by:
visitWhileLoopin 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 a ForLoopTree node.- Specified by:
visitForLoopin 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 an EnhancedForLoopTree node.- Specified by:
visitEnhancedForLoopin 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 a LabeledStatementTree node.- Specified by:
visitLabeledStatementin 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 a SwitchTree node.- Specified by:
visitSwitchin 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 a SwitchExpressionTree node.- Specified by:
visitSwitchExpressionin 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 a CaseTree node.- Specified by:
visitCasein 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 a SynchronizedTree node.- Specified by:
visitSynchronizedin 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 a TryTree node.- Specified by:
visitTryin 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 a CatchTree node.- Specified by:
visitCatchin 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 a ConditionalExpressionTree node.- Specified by:
visitConditionalExpressionin 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 an IfTree node.- Specified by:
visitIfin 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 an ExpressionStatementTree node.- Specified by:
visitExpressionStatementin 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 a BreakTree node.- Specified by:
visitBreakin 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 a ContinueTree node.- Specified by:
visitContinuein 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 a ReturnTree node.- Specified by:
visitReturnin 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 a ThrowTree node.- Specified by:
visitThrowin 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 an AssertTree node.- Specified by:
visitAssertin 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 a MethodInvocationTree node.- Specified by:
visitMethodInvocationin 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 a NewClassTree node.- Specified by:
visitNewClassin 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 a NewArrayTree node.- Specified by:
visitNewArrayin 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 a LambdaExpressionTree node.- Specified by:
visitLambdaExpressionin 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 a ParenthesizedTree node.- Specified by:
visitParenthesizedin 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 an AssignmentTree node.- Specified by:
visitAssignmentin 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 a CompoundAssignmentTree node.- Specified by:
visitCompoundAssignmentin 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 a UnaryTree node.- Specified by:
visitUnaryin 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 a BinaryTree node.- Specified by:
visitBinaryin 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 a TypeCastTree node.- Specified by:
visitTypeCastin 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 an InstanceOfTree node.- Specified by:
visitInstanceOfin 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 an BindingPattern node.- Specified by:
visitBindingPatternin 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
visitDefaultCaseLabelis 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 DefaultCaseLabelTree node.- Specified by:
visitDefaultCaseLabelin 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
-
visitArrayAccess
Visits an ArrayAccessTree node.- Specified by:
visitArrayAccessin 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
-
visitMemberSelect
Visits a MemberSelectTree node.- Specified by:
visitMemberSelectin 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
visitParenthesizedPatternis 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 ParenthesizedPatternTree node.- Specified by:
visitParenthesizedPatternin 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
-
visitGuardedPattern
visitGuardedPatternis 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 GuardPatternTree node.- Specified by:
visitGuardedPatternin 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 a MemberReferenceTree node.- Specified by:
visitMemberReferencein 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 an IdentifierTree node.- Specified by:
visitIdentifierin 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 a LiteralTree node.- Specified by:
visitLiteralin 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 a PrimitiveTypeTree node.- Specified by:
visitPrimitiveTypein 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 an ArrayTypeTree node.- Specified by:
visitArrayTypein 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 a ParameterizedTypeTree node.- Specified by:
visitParameterizedTypein 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 a UnionTypeTree node.- Specified by:
visitUnionTypein 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 an IntersectionTypeTree node.- Specified by:
visitIntersectionTypein 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 a TypeParameterTree node.- Specified by:
visitTypeParameterin 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 a WildcardTypeTree node.- Specified by:
visitWildcardin 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 a ModifiersTree node.- Specified by:
visitModifiersin 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 an AnnotatedTree node.- Specified by:
visitAnnotationin 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 an AnnotatedTypeTree node.- Specified by:
visitAnnotatedTypein 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 a ModuleTree node.- Specified by:
visitModulein 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 an ExportsTree node.- Specified by:
visitExportsin 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 an OpensTree node.- Specified by:
visitOpensin 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 a ProvidesTree node.- Specified by:
visitProvidesin 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 a RequiresTree node.- Specified by:
visitRequiresin 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 a UsesTree node.- Specified by:
visitUsesin 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 of Tree node. This can occur if the language evolves and new kinds of nodes are added to theTreehierarchy.- Specified by:
visitOtherin 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 an ErroneousTree node.- Specified by:
visitErroneousin 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 a YieldTree node.- Specified by:
visitYieldin 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
-
TreeScannerwhen preview features are enabled.