Interface Tree
- All Known Subinterfaces:
-
ArrayAccessTree
,ArrayLiteralTree
,AssignmentTree
,BinaryTree
,BlockTree
,BreakTree
,CaseTree
,CatchTree
,ClassDeclarationTree
,ClassExpressionTree
,CompilationUnitTree
,CompoundAssignmentTree
,ConditionalExpressionTree
,ConditionalLoopTree
,ContinueTree
,DebuggerTree
,DoWhileLoopTree
,EmptyStatementTree
,ErroneousTree
,ExportEntryTree
,ExpressionStatementTree
,ExpressionTree
,ForInLoopTree
,ForLoopTree
,ForOfLoopTree
,FunctionCallTree
,FunctionDeclarationTree
,FunctionExpressionTree
,GotoTree
,IdentifierTree
,IfTree
,ImportEntryTree
,InstanceOfTree
,LabeledStatementTree
,LiteralTree
,LoopTree
,MemberSelectTree
,ModuleTree
,NewTree
,ObjectLiteralTree
,ParenthesizedTree
,PropertyTree
,RegExpLiteralTree
,ReturnTree
,SpreadTree
,StatementTree
,SwitchTree
,TemplateLiteralTree
,ThrowTree
,TryTree
,UnaryTree
,VariableTree
,WhileLoopTree
,WithTree
,YieldTree
@Deprecated(since="11", forRemoval=true) public interface Tree
Common interface for all nodes in an abstract syntax tree.
WARNING: This interface and its sub-interfaces are subject to change as the ECMAScript programming language evolves.
- Since:
- 9
Nested Classes
Modifier and Type | Interface | Description |
---|---|---|
static class | Tree.Kind | 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. |
Methods
Modifier and Type | Method | Description |
---|---|---|
<R,D> | accept(TreeVisitor<R,D> visitor,
D data) | Deprecated, for removal: This API element is subject to removal in a future version. Accept method used to implement the visitor pattern. |
long | getEndPosition() | Deprecated, for removal: This API element is subject to removal in a future version. End character offset of this Tree within the source. |
Tree.Kind | getKind() | Deprecated, for removal: This API element is subject to removal in a future version. Gets the kind of this tree. |
long | getStartPosition() | Deprecated, for removal: This API element is subject to removal in a future version. Start character offset of this Tree within the source. |
Methods
getStartPosition
long getStartPosition()
Start character offset of this Tree within the source.
- Returns:
- the position
getEndPosition
long getEndPosition()
End character offset of this Tree within the source.
- Returns:
- the position
getKind
Tree.Kind getKind()
Gets the kind of this tree.
- Returns:
- the kind of this tree.
accept
<R,D> R accept(TreeVisitor<R,D> visitor, D data)
Accept method used to implement the visitor pattern. The visitor pattern is used to implement operations on trees.
- Type Parameters:
-
R
- result type of this operation. -
D
- type of additional data. - Parameters:
-
visitor
- tree visitor -
data
- additional data passed to visitor methods - Returns:
- the value from visitor's visit methods
© 1993, 2020, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/11/docs/api/jdk.scripting.nashorn/jdk/nashorn/api/tree/Tree.html