- 
- Type Parameters:
- R- the return type of this visitor's methods. Use- Voidfor visitors that do not need to return results.
- P- the type of the additional parameter to this visitor's methods. Use- Voidfor 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'sacceptmethod, thevisitXyzmethod most applicable to that tree is invoked.Classes implementing this interface may or may not throw a NullPointerExceptionif the additional parameterpisnull; 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 SummaryAll Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description RvisitArrayAccess(ArrayAccessTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit array access expression tree.RvisitArrayLiteral(ArrayLiteralTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit array literal expression tree.RvisitAssignment(AssignmentTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit assignment tree.RvisitBinary(BinaryTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit binary expression tree.RvisitBlock(BlockTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit block statement tree.RvisitBreak(BreakTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit break statement tree.RvisitCase(CaseTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit case statement tree.RvisitCatch(CatchTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit catch block statement tree.RvisitClassDeclaration(ClassDeclarationTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit class statement tree.RvisitClassExpression(ClassExpressionTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit class expression tree.RvisitCompilationUnit(CompilationUnitTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit compilation unit tree.RvisitCompoundAssignment(CompoundAssignmentTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit compound assignment tree.RvisitConditionalExpression(ConditionalExpressionTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit conditional expression tree.RvisitContinue(ContinueTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit continue statement tree.RvisitDebugger(DebuggerTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit debugger statement tree.RvisitDoWhileLoop(DoWhileLoopTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit do-while statement tree.RvisitEmptyStatement(EmptyStatementTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit an empty statement tree.RvisitErroneous(ErroneousTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit error expression tree.RvisitExportEntry(ExportEntryTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit Module ExportEntry tree.RvisitExpressionStatement(ExpressionStatementTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit expression statement tree.RvisitForInLoop(ForInLoopTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit for..in statement tree.RvisitForLoop(ForLoopTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit 'for' statement tree.RvisitForOfLoop(ForOfLoopTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit for..of statement tree.RvisitFunctionCall(FunctionCallTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit function call expression tree.RvisitFunctionDeclaration(FunctionDeclarationTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit function declaration tree.RvisitFunctionExpression(FunctionExpressionTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit function expression tree.RvisitIdentifier(IdentifierTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit identifier tree.RvisitIf(IfTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit 'if' statement tree.RvisitImportEntry(ImportEntryTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit Module ImportEntry tree.RvisitInstanceOf(InstanceOfTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit 'instanceof' expression tree.RvisitLabeledStatement(LabeledStatementTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit labeled statement tree.RvisitLiteral(LiteralTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit literal expression tree.RvisitMemberSelect(MemberSelectTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit member select expression tree.RvisitModule(ModuleTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit Module tree.RvisitNew(NewTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit 'new' expression tree.RvisitObjectLiteral(ObjectLiteralTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit object literal tree.RvisitParenthesized(ParenthesizedTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit parenthesized expression tree.RvisitProperty(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.RvisitRegExpLiteral(RegExpLiteralTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit regular expression literal tree.RvisitReturn(ReturnTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit return statement tree.RvisitSpread(SpreadTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit 'spread' expression tree.RvisitSwitch(SwitchTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit 'switch' statement tree.RvisitTemplateLiteral(TemplateLiteralTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit template literal tree.RvisitThrow(ThrowTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit 'throw' expression tree.RvisitTry(TryTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit 'try' statement tree.RvisitUnary(UnaryTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit unary expression tree.RvisitUnknown(Tree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit unknown expression/statement tree.RvisitVariable(VariableTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit variable declaration tree.RvisitWhileLoop(WhileLoopTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit 'while' statement tree.RvisitWith(WithTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit 'with' statement tree.RvisitYield(YieldTree node, P p)Deprecated, for removal: This API element is subject to removal in a future version.Visit 'yield' expression tree.
 
- 
- 
- 
Method Detail- 
visitAssignmentR visitAssignment(AssignmentTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit assignment tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitCompoundAssignmentR visitCompoundAssignment(CompoundAssignmentTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit compound assignment tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitBinaryR visitBinary(BinaryTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit binary expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitBlockR visitBlock(BlockTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit block statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitBreakR visitBreak(BreakTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit break statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitCaseR visitCase(CaseTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit case statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitCatchR visitCatch(CatchTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit catch block statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitClassDeclarationR visitClassDeclaration(ClassDeclarationTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit class statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitClassExpressionR visitClassExpression(ClassExpressionTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit class expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitConditionalExpressionR visitConditionalExpression(ConditionalExpressionTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit conditional expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitContinueR visitContinue(ContinueTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit continue statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitDebuggerR visitDebugger(DebuggerTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit debugger statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitDoWhileLoopR visitDoWhileLoop(DoWhileLoopTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit do-while statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitErroneousR visitErroneous(ErroneousTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit error expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitExpressionStatementR visitExpressionStatement(ExpressionStatementTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit expression statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitForLoopR visitForLoop(ForLoopTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit 'for' statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitForInLoopR visitForInLoop(ForInLoopTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit for..in statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitForOfLoopR visitForOfLoop(ForOfLoopTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit for..of statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitFunctionCallR visitFunctionCall(FunctionCallTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit function call expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitFunctionDeclarationR visitFunctionDeclaration(FunctionDeclarationTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit function declaration tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitFunctionExpressionR visitFunctionExpression(FunctionExpressionTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit function expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitIdentifierR visitIdentifier(IdentifierTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit identifier tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitIfR visitIf(IfTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit 'if' statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitArrayAccessR visitArrayAccess(ArrayAccessTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit array access expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitArrayLiteralR visitArrayLiteral(ArrayLiteralTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit array literal expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitLabeledStatementR visitLabeledStatement(LabeledStatementTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit labeled statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitLiteralR visitLiteral(LiteralTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit literal expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitParenthesizedR visitParenthesized(ParenthesizedTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit parenthesized expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitReturnR visitReturn(ReturnTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit return statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitMemberSelectR visitMemberSelect(MemberSelectTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit member select expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitNewR visitNew(NewTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit 'new' expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitObjectLiteralR visitObjectLiteral(ObjectLiteralTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit object literal tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitPropertyR 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.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitRegExpLiteralR visitRegExpLiteral(RegExpLiteralTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit regular expression literal tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitTemplateLiteralR visitTemplateLiteral(TemplateLiteralTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit template literal tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitEmptyStatementR visitEmptyStatement(EmptyStatementTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit an empty statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitSpreadR visitSpread(SpreadTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit 'spread' expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitSwitchR visitSwitch(SwitchTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit 'switch' statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitThrowR visitThrow(ThrowTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit 'throw' expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitCompilationUnitR visitCompilationUnit(CompilationUnitTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit compilation unit tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitModuleR visitModule(ModuleTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit Module tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitExportEntryR visitExportEntry(ExportEntryTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit Module ExportEntry tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitImportEntryR visitImportEntry(ImportEntryTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit Module ImportEntry tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitTryR visitTry(TryTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit 'try' statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitInstanceOfR visitInstanceOf(InstanceOfTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit 'instanceof' expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitUnaryR visitUnary(UnaryTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit unary expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitVariableR visitVariable(VariableTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit variable declaration tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitWhileLoopR visitWhileLoop(WhileLoopTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit 'while' statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitWithR visitWith(WithTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit 'with' statement tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitYieldR visitYield(YieldTree node, P p) Deprecated, for removal: This API element is subject to removal in a future version.Visit 'yield' expression tree.- Parameters:
- node- node being visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 - 
visitUnknownR visitUnknown(Tree node, P p) 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 visited
- p- extra parameter passed to the visitor
- Returns:
- value from the visitor
 
 
- 
 
-