- 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 Known Implementing Classes:
SimpleTreeVisitorES5_1
,SimpleTreeVisitorES6
@Deprecated(since="11", forRemoval=true) public interface TreeVisitor<R,P>
Deprecated, for removal: This API element is subject to removal in a future version.
Nashorn JavaScript script engine and APIs, and the jjs tool
are deprecated with the intent to remove them in a future release.
A visitor of trees, in the style of the visitor design pattern.
Classes implementing this interface are used to operate
on a tree when the kind of tree is unknown at compile time.
When a visitor is passed to an tree's
accept
method, the visitXyz
method most applicable
to that tree is invoked.
Classes implementing this interface may or may not throw a
NullPointerException
if the additional parameter p
is null
; see documentation of the implementing class for
details.
WARNING: It is possible that methods will be added to this interface to accommodate new, currently unknown, language structures added to future versions of the ECMAScript programming language. When new visit methods are added for new Tree subtypes, default method bodies will be introduced which will call visitUnknown method as a fallback.
- Since:
- 9
-
Method Summary
Modifier and Type Method Description R
visitArrayAccess(ArrayAccessTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit array access expression tree.R
visitArrayLiteral(ArrayLiteralTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit array literal expression tree.R
visitAssignment(AssignmentTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit assignment tree.R
visitBinary(BinaryTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit binary expression tree.R
visitBlock(BlockTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit block statement tree.R
visitBreak(BreakTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit break statement tree.R
visitCase(CaseTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit case statement tree.R
visitCatch(CatchTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit catch block statement tree.R
visitClassDeclaration(ClassDeclarationTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit class statement tree.R
visitClassExpression(ClassExpressionTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit class expression tree.R
visitCompilationUnit(CompilationUnitTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit compilation unit tree.R
visitCompoundAssignment(CompoundAssignmentTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit compound assignment tree.R
visitConditionalExpression(ConditionalExpressionTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit conditional expression tree.R
visitContinue(ContinueTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit continue statement tree.R
visitDebugger(DebuggerTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit debugger statement tree.R
visitDoWhileLoop(DoWhileLoopTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit do-while statement tree.R
visitEmptyStatement(EmptyStatementTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit an empty statement tree.R
visitErroneous(ErroneousTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit error expression tree.R
visitExportEntry(ExportEntryTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit Module ExportEntry tree.R
visitExpressionStatement(ExpressionStatementTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit expression statement tree.R
visitForInLoop(ForInLoopTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit for..in statement tree.R
visitForLoop(ForLoopTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit 'for' statement tree.R
visitForOfLoop(ForOfLoopTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit for..of statement tree.R
visitFunctionCall(FunctionCallTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit function call expression tree.R
visitFunctionDeclaration(FunctionDeclarationTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit function declaration tree.R
visitFunctionExpression(FunctionExpressionTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit function expression tree.R
visitIdentifier(IdentifierTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit identifier tree.R
visitIf(IfTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit 'if' statement tree.R
visitImportEntry(ImportEntryTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit Module ImportEntry tree.R
visitInstanceOf(InstanceOfTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit 'instanceof' expression tree.R
visitLabeledStatement(LabeledStatementTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit labeled statement tree.R
visitLiteral(LiteralTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit literal expression tree.R
visitMemberSelect(MemberSelectTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit member select expression tree.R
visitModule(ModuleTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit Module tree.R
visitNew(NewTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit 'new' expression tree.R
visitObjectLiteral(ObjectLiteralTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit object literal tree.R
visitParenthesized(ParenthesizedTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit parenthesized expression tree.R
visitProperty(PropertyTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit a property of an object literal expression tree.R
visitRegExpLiteral(RegExpLiteralTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit regular expression literal tree.R
visitReturn(ReturnTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit return statement tree.R
visitSpread(SpreadTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit 'spread' expression tree.R
visitSwitch(SwitchTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit 'switch' statement tree.R
visitTemplateLiteral(TemplateLiteralTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit template literal tree.R
visitThrow(ThrowTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit 'throw' expression tree.R
visitTry(TryTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit 'try' statement tree.R
visitUnary(UnaryTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit unary expression tree.R
visitUnknown(Tree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit unknown expression/statement tree.R
visitVariable(VariableTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit variable declaration tree.R
visitWhileLoop(WhileLoopTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit 'while' statement tree.R
visitWith(WithTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit 'with' statement tree.R
visitYield(YieldTree node, P p)
Deprecated, for removal: This API element is subject to removal in a future version.Visit 'yield' expression tree.
-
Method Details
-
visitAssignment
Deprecated, for removal: This API element is subject to removal in a future version.Visit assignment tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitCompoundAssignment
Deprecated, for removal: This API element is subject to removal in a future version.Visit compound assignment tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitBinary
Deprecated, for removal: This API element is subject to removal in a future version.Visit binary expression tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitBlock
Deprecated, for removal: This API element is subject to removal in a future version.Visit block statement tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitBreak
Deprecated, for removal: This API element is subject to removal in a future version.Visit break statement tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitCase
Deprecated, for removal: This API element is subject to removal in a future version.Visit case statement tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitCatch
Deprecated, for removal: This API element is subject to removal in a future version.Visit catch block statement tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitClassDeclaration
Deprecated, for removal: This API element is subject to removal in a future version.Visit class statement tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitClassExpression
Deprecated, for removal: This API element is subject to removal in a future version.Visit class expression tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitConditionalExpression
Deprecated, for removal: This API element is subject to removal in a future version.Visit conditional expression tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitContinue
Deprecated, for removal: This API element is subject to removal in a future version.Visit continue statement tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitDebugger
Deprecated, for removal: This API element is subject to removal in a future version.Visit debugger statement tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitDoWhileLoop
Deprecated, for removal: This API element is subject to removal in a future version.Visit do-while statement tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitErroneous
Deprecated, for removal: This API element is subject to removal in a future version.Visit error expression tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitExpressionStatement
Deprecated, for removal: This API element is subject to removal in a future version.Visit expression statement tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitForLoop
Deprecated, for removal: This API element is subject to removal in a future version.Visit 'for' statement tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitForInLoop
Deprecated, for removal: This API element is subject to removal in a future version.Visit for..in statement tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitForOfLoop
Deprecated, for removal: This API element is subject to removal in a future version.Visit for..of statement tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitFunctionCall
Deprecated, for removal: This API element is subject to removal in a future version.Visit function call expression tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitFunctionDeclaration
Deprecated, for removal: This API element is subject to removal in a future version.Visit function declaration tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitFunctionExpression
Deprecated, for removal: This API element is subject to removal in a future version.Visit function expression tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitIdentifier
Deprecated, for removal: This API element is subject to removal in a future version.Visit identifier tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitIf
Deprecated, for removal: This API element is subject to removal in a future version.Visit 'if' statement tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitArrayAccess
Deprecated, for removal: This API element is subject to removal in a future version.Visit array access expression tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitArrayLiteral
Deprecated, for removal: This API element is subject to removal in a future version.Visit array literal expression tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitLabeledStatement
Deprecated, for removal: This API element is subject to removal in a future version.Visit labeled statement tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitLiteral
Deprecated, for removal: This API element is subject to removal in a future version.Visit literal expression tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitParenthesized
Deprecated, for removal: This API element is subject to removal in a future version.Visit parenthesized expression tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitReturn
Deprecated, for removal: This API element is subject to removal in a future version.Visit return statement tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitMemberSelect
Deprecated, for removal: This API element is subject to removal in a future version.Visit member select expression tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitNew
Deprecated, for removal: This API element is subject to removal in a future version.Visit 'new' expression tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitObjectLiteral
Deprecated, for removal: This API element is subject to removal in a future version.Visit object literal tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitProperty
Deprecated, for removal: This API element is subject to removal in a future version.Visit a property of an object literal expression tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitRegExpLiteral
Deprecated, for removal: This API element is subject to removal in a future version.Visit regular expression literal tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitTemplateLiteral
Deprecated, for removal: This API element is subject to removal in a future version.Visit template literal tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitEmptyStatement
Deprecated, for removal: This API element is subject to removal in a future version.Visit an empty statement tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitSpread
Deprecated, for removal: This API element is subject to removal in a future version.Visit 'spread' expression tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitSwitch
Deprecated, for removal: This API element is subject to removal in a future version.Visit 'switch' statement tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitThrow
Deprecated, for removal: This API element is subject to removal in a future version.Visit 'throw' expression tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitCompilationUnit
Deprecated, for removal: This API element is subject to removal in a future version.Visit compilation unit tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitModule
Deprecated, for removal: This API element is subject to removal in a future version.Visit Module tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitExportEntry
Deprecated, for removal: This API element is subject to removal in a future version.Visit Module ExportEntry tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitImportEntry
Deprecated, for removal: This API element is subject to removal in a future version.Visit Module ImportEntry tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitTry
Deprecated, for removal: This API element is subject to removal in a future version.Visit 'try' statement tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitInstanceOf
Deprecated, for removal: This API element is subject to removal in a future version.Visit 'instanceof' expression tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitUnary
Deprecated, for removal: This API element is subject to removal in a future version.Visit unary expression tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitVariable
Deprecated, for removal: This API element is subject to removal in a future version.Visit variable declaration tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitWhileLoop
Deprecated, for removal: This API element is subject to removal in a future version.Visit 'while' statement tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitWith
Deprecated, for removal: This API element is subject to removal in a future version.Visit 'with' statement tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitYield
Deprecated, for removal: This API element is subject to removal in a future version.Visit 'yield' expression tree.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-
visitUnknown
Deprecated, for removal: This API element is subject to removal in a future version.Visit unknown expression/statement tree. This fallback will be called if new Tree subtypes are introduced in future. A specific implementation may throw {unknown tree exception if the visitor implementation was for an older language version.- Parameters:
node
- node being visitedp
- extra parameter passed to the visitor- Returns:
- value from the visitor
-