R
- the return type of this visitor's methods. Use Void
for visitors that do not need to return results.P
- the type of the additional parameter to this visitor's
methods. Use Void
for visitors that do not need an
additional parameter.TreeVisitor<R,P>
public class SimpleTreeVisitor<R,P> extends Object implements TreeVisitor<R,P>
Modifier and Type | Field | Description |
---|---|---|
protected R |
DEFAULT_VALUE |
The default value, returned by the
default action . |
Modifier | Constructor | Description |
---|---|---|
protected |
SimpleTreeVisitor() |
Creates a visitor, with a DEFAULT_VALUE of
null . |
protected |
SimpleTreeVisitor(R defaultValue) |
Creates a visitor, with a specified DEFAULT_VALUE.
|
Modifier and Type | Method | Description |
---|---|---|
protected R |
defaultAction(Tree node,
P p) |
The default action, used by all visit methods that are not overridden.
|
R |
visit(Tree node,
P p) |
Invokes the appropriate visit method specific to the type of the node.
|
R |
visit(Iterable<? extends Tree> nodes,
P p) |
Invokes the appropriate visit method on each of a sequence of nodes.
|
R |
visitAnnotatedType(AnnotatedTypeTree node,
P p) |
Visits an AnnotatedTypeTree node.
|
R |
visitAnnotation(AnnotationTree node,
P p) |
Visits an AnnotatedTree node.
|
R |
visitArrayAccess(ArrayAccessTree node,
P p) |
Visits an ArrayAccessTree node.
|
R |
visitArrayType(ArrayTypeTree node,
P p) |
Visits an ArrayTypeTree node.
|
R |
visitAssert(AssertTree node,
P p) |
Visits an AssertTree node.
|
R |
visitAssignment(AssignmentTree node,
P p) |
Visits an AssignmentTree node.
|
R |
visitBinary(BinaryTree node,
P p) |
Visits a BinaryTree node.
|
R |
visitBlock(BlockTree node,
P p) |
Visits a BlockTree node.
|
R |
visitBreak(BreakTree node,
P p) |
Visits a BreakTree node.
|
R |
visitCase(CaseTree node,
P p) |
Visits a CaseTree node.
|
R |
visitCatch(CatchTree node,
P p) |
Visits a CatchTree node.
|
R |
visitClass(ClassTree node,
P p) |
Visits a ClassTree node.
|
R |
visitCompilationUnit(CompilationUnitTree node,
P p) |
Visits a CompilationUnitTree node.
|
R |
visitCompoundAssignment(CompoundAssignmentTree node,
P p) |
Visits a CompoundAssignmentTree node.
|
R |
visitConditionalExpression(ConditionalExpressionTree node,
P p) |
Visits a ConditionalExpressionTree node.
|
R |
visitContinue(ContinueTree node,
P p) |
Visits a ContinueTree node.
|
R |
visitDoWhileLoop(DoWhileLoopTree node,
P p) |
Visits a DoWhileTree node.
|
R |
visitEmptyStatement(EmptyStatementTree node,
P p) |
Visits an EmptyStatementTree node.
|
R |
visitEnhancedForLoop(EnhancedForLoopTree node,
P p) |
Visits an EnhancedForLoopTree node.
|
R |
visitErroneous(ErroneousTree node,
P p) |
Visits an ErroneousTree node.
|
R |
visitExports(ExportsTree node,
P p) |
Visits an ExportsTree node.
|
R |
visitExpressionStatement(ExpressionStatementTree node,
P p) |
Visits an ExpressionStatementTree node.
|
R |
visitForLoop(ForLoopTree node,
P p) |
Visits a ForLoopTree node.
|
R |
visitIdentifier(IdentifierTree node,
P p) |
Visits an IdentifierTree node.
|
R |
visitIf(IfTree node,
P p) |
Visits an IfTree node.
|
R |
visitImport(ImportTree node,
P p) |
Visits an ImportTree node.
|
R |
visitInstanceOf(InstanceOfTree node,
P p) |
Visits an InstanceOfTree node.
|
R |
visitIntersectionType(IntersectionTypeTree node,
P p) |
Visits an IntersectionTypeTree node.
|
R |
visitLabeledStatement(LabeledStatementTree node,
P p) |
Visits a LabeledStatementTree node.
|
R |
visitLambdaExpression(LambdaExpressionTree node,
P p) |
Visits a LambdaExpressionTree node.
|
R |
visitLiteral(LiteralTree node,
P p) |
Visits a LiteralTree node.
|
R |
visitMemberReference(MemberReferenceTree node,
P p) |
Visits a MemberReferenceTree node.
|
R |
visitMemberSelect(MemberSelectTree node,
P p) |
Visits a MemberSelectTree node.
|
R |
visitMethod(MethodTree node,
P p) |
Visits a MethodTree node.
|
R |
visitMethodInvocation(MethodInvocationTree node,
P p) |
Visits a MethodInvocationTree node.
|
R |
visitModifiers(ModifiersTree node,
P p) |
Visits a ModifiersTree node.
|
R |
visitModule(ModuleTree node,
P p) |
Visits a ModuleTree node.
|
R |
visitNewArray(NewArrayTree node,
P p) |
Visits a NewArrayTree node.
|
R |
visitNewClass(NewClassTree node,
P p) |
Visits a NewClassTree node.
|
R |
visitOpens(OpensTree node,
P p) |
Visits an OpensTree node.
|
R |
visitOther(Tree node,
P p) |
Visits an unknown type of Tree node.
|
R |
visitPackage(PackageTree node,
P p) |
Visits a PackageTree node.
|
R |
visitParameterizedType(ParameterizedTypeTree node,
P p) |
Visits a ParameterizedTypeTree node.
|
R |
visitParenthesized(ParenthesizedTree node,
P p) |
Visits a ParenthesizedTree node.
|
R |
visitPrimitiveType(PrimitiveTypeTree node,
P p) |
Visits a PrimitiveTypeTree node.
|
R |
visitProvides(ProvidesTree node,
P p) |
Visits a ProvidesTree node.
|
R |
visitRequires(RequiresTree node,
P p) |
Visits a RequiresTree node.
|
R |
visitReturn(ReturnTree node,
P p) |
Visits a ReturnTree node.
|
R |
visitSwitch(SwitchTree node,
P p) |
Visits a SwitchTree node.
|
R |
visitSynchronized(SynchronizedTree node,
P p) |
Visits a SynchronizedTree node.
|
R |
visitThrow(ThrowTree node,
P p) |
Visits a ThrowTree node.
|
R |
visitTry(TryTree node,
P p) |
Visits a TryTree node.
|
R |
visitTypeCast(TypeCastTree node,
P p) |
Visits a TypeCastTree node.
|
R |
visitTypeParameter(TypeParameterTree node,
P p) |
Visits a TypeParameterTree node.
|
R |
visitUnary(UnaryTree node,
P p) |
Visits a UnaryTree node.
|
R |
visitUnionType(UnionTypeTree node,
P p) |
Visits a UnionTypeTree node.
|
R |
visitUses(UsesTree node,
P p) |
Visits a UsesTree node.
|
R |
visitVariable(VariableTree node,
P p) |
Visits a VariableTree node.
|
R |
visitWhileLoop(WhileLoopTree node,
P p) |
Visits a WhileLoopTree node.
|
R |
visitWildcard(WildcardTree node,
P p) |
Visits a WildcardTypeTree node.
|
protected final R DEFAULT_VALUE
default action
.protected SimpleTreeVisitor()
null
.protected SimpleTreeVisitor(R defaultValue)
defaultValue
- the default value to be returned by the default action.protected R defaultAction(Tree node, P p)
node
- the node being visitedp
- the parameter value passed to the visit methodpublic final R visit(Tree node, P p)
node
- the node on which to dispatchp
- a parameter to be passed to the appropriate visit methodpublic final R visit(Iterable<? extends Tree> nodes, P p)
nodes
- the nodes on which to dispatchp
- a parameter value to be passed to each appropriate visit methodpublic R visitCompilationUnit(CompilationUnitTree node, P p)
defaultAction
.visitCompilationUnit
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitPackage(PackageTree node, P p)
defaultAction
.visitPackage
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitImport(ImportTree node, P p)
defaultAction
.visitImport
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitClass(ClassTree node, P p)
defaultAction
.visitClass
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitMethod(MethodTree node, P p)
defaultAction
.visitMethod
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitVariable(VariableTree node, P p)
defaultAction
.visitVariable
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitEmptyStatement(EmptyStatementTree node, P p)
defaultAction
.visitEmptyStatement
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitBlock(BlockTree node, P p)
defaultAction
.visitBlock
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitDoWhileLoop(DoWhileLoopTree node, P p)
defaultAction
.visitDoWhileLoop
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitWhileLoop(WhileLoopTree node, P p)
defaultAction
.visitWhileLoop
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitForLoop(ForLoopTree node, P p)
defaultAction
.visitForLoop
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitEnhancedForLoop(EnhancedForLoopTree node, P p)
defaultAction
.visitEnhancedForLoop
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitLabeledStatement(LabeledStatementTree node, P p)
defaultAction
.visitLabeledStatement
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitSwitch(SwitchTree node, P p)
defaultAction
.visitSwitch
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitCase(CaseTree node, P p)
defaultAction
.visitCase
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitSynchronized(SynchronizedTree node, P p)
defaultAction
.visitSynchronized
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitTry(TryTree node, P p)
defaultAction
.visitTry
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitCatch(CatchTree node, P p)
defaultAction
.visitCatch
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitConditionalExpression(ConditionalExpressionTree node, P p)
defaultAction
.visitConditionalExpression
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitIf(IfTree node, P p)
defaultAction
.visitIf
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitExpressionStatement(ExpressionStatementTree node, P p)
defaultAction
.visitExpressionStatement
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitBreak(BreakTree node, P p)
defaultAction
.visitBreak
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitContinue(ContinueTree node, P p)
defaultAction
.visitContinue
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitReturn(ReturnTree node, P p)
defaultAction
.visitReturn
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitThrow(ThrowTree node, P p)
defaultAction
.visitThrow
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitAssert(AssertTree node, P p)
defaultAction
.visitAssert
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitMethodInvocation(MethodInvocationTree node, P p)
defaultAction
.visitMethodInvocation
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitNewClass(NewClassTree node, P p)
defaultAction
.visitNewClass
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitNewArray(NewArrayTree node, P p)
defaultAction
.visitNewArray
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitLambdaExpression(LambdaExpressionTree node, P p)
defaultAction
.visitLambdaExpression
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitParenthesized(ParenthesizedTree node, P p)
defaultAction
.visitParenthesized
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitAssignment(AssignmentTree node, P p)
defaultAction
.visitAssignment
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitCompoundAssignment(CompoundAssignmentTree node, P p)
defaultAction
.visitCompoundAssignment
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitUnary(UnaryTree node, P p)
defaultAction
.visitUnary
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitBinary(BinaryTree node, P p)
defaultAction
.visitBinary
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitTypeCast(TypeCastTree node, P p)
defaultAction
.visitTypeCast
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitInstanceOf(InstanceOfTree node, P p)
defaultAction
.visitInstanceOf
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitArrayAccess(ArrayAccessTree node, P p)
defaultAction
.visitArrayAccess
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitMemberSelect(MemberSelectTree node, P p)
defaultAction
.visitMemberSelect
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitMemberReference(MemberReferenceTree node, P p)
defaultAction
.visitMemberReference
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitIdentifier(IdentifierTree node, P p)
defaultAction
.visitIdentifier
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitLiteral(LiteralTree node, P p)
defaultAction
.visitLiteral
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitPrimitiveType(PrimitiveTypeTree node, P p)
defaultAction
.visitPrimitiveType
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitArrayType(ArrayTypeTree node, P p)
defaultAction
.visitArrayType
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitParameterizedType(ParameterizedTypeTree node, P p)
defaultAction
.visitParameterizedType
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitUnionType(UnionTypeTree node, P p)
defaultAction
.visitUnionType
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitIntersectionType(IntersectionTypeTree node, P p)
defaultAction
.visitIntersectionType
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitTypeParameter(TypeParameterTree node, P p)
defaultAction
.visitTypeParameter
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitWildcard(WildcardTree node, P p)
defaultAction
.visitWildcard
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitModifiers(ModifiersTree node, P p)
defaultAction
.visitModifiers
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitAnnotation(AnnotationTree node, P p)
defaultAction
.visitAnnotation
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitAnnotatedType(AnnotatedTypeTree node, P p)
defaultAction
.visitAnnotatedType
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
public R visitModule(ModuleTree node, P p)
TreeVisitor
visitModule
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuepublic R visitExports(ExportsTree node, P p)
TreeVisitor
visitExports
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuepublic R visitOpens(OpensTree node, P p)
TreeVisitor
visitOpens
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuepublic R visitProvides(ProvidesTree node, P p)
TreeVisitor
visitProvides
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuepublic R visitRequires(RequiresTree node, P p)
TreeVisitor
visitRequires
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuepublic R visitUses(UsesTree node, P p)
TreeVisitor
visitUses
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuepublic R visitErroneous(ErroneousTree node, P p)
TreeVisitor
visitErroneous
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuepublic R visitOther(Tree node, P p)
Tree
hierarchy. This implementation calls defaultAction
.visitOther
in interface TreeVisitor<R,P>
node
- the node being visitedp
- a parameter valuedefaultAction
Submit a bug or feature
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 2005, 2017, Oracle and/or its affiliates. 500 Oracle Parkway
Redwood Shores, CA 94065 USA. All rights reserved.
DRAFT 9-Ubuntu+0-9b151-2