On this page
Interface Tree
- All Known Subinterfaces:
AnnotatedTypeTree
,AnnotationTree
,AnyPatternTreePREVIEW
,ArrayAccessTree
,ArrayTypeTree
,AssertTree
,AssignmentTree
,BinaryTree
,BindingPatternTree
,BlockTree
,BreakTree
,CaseLabelTree
,CaseTree
,CatchTree
,ClassTree
,CompilationUnitTree
,CompoundAssignmentTree
,ConditionalExpressionTree
,ConstantCaseLabelTree
,ContinueTree
,DeconstructionPatternTree
,DefaultCaseLabelTree
,DirectiveTree
,DoWhileLoopTree
,EmptyStatementTree
,EnhancedForLoopTree
,ErroneousTree
,ExportsTree
,ExpressionStatementTree
,ExpressionTree
,ForLoopTree
,IdentifierTree
,IfTree
,ImportTree
,InstanceOfTree
,IntersectionTypeTree
,LabeledStatementTree
,LambdaExpressionTree
,LiteralTree
,MemberReferenceTree
,MemberSelectTree
,MethodInvocationTree
,MethodTree
,ModifiersTree
,ModuleTree
,NewArrayTree
,NewClassTree
,OpensTree
,PackageTree
,ParameterizedTypeTree
,ParenthesizedTree
,PatternCaseLabelTree
,PatternTree
,PrimitiveTypeTree
,ProvidesTree
,RequiresTree
,ReturnTree
,StatementTree
,StringTemplateTreePREVIEW
,SwitchExpressionTree
,SwitchTree
,SynchronizedTree
,ThrowTree
,TryTree
,TypeCastTree
,TypeParameterTree
,UnaryTree
,UnionTypeTree
,UsesTree
,VariableTree
,WhileLoopTree
,WildcardTree
,YieldTree
public interface Tree
WARNING: This interface and its sub-interfaces are subject to change as the Java programming language evolves. These interfaces are implemented by the JDK Java compiler (javac) and should not be implemented either directly or indirectly by other applications.
- Since:
- 1.6
Nested Class Summary
Modifier and Type | Interface | Description |
---|---|---|
static enum |
Tree.Kind |
Enumerates all kinds of trees.
|
Method Summary
Modifier and Type | Method | Description |
---|---|---|
<R, |
accept |
Accept method used to implement the visitor pattern.
|
Tree.Kind |
getKind() |
Returns the kind of this tree.
|
Method Details
getKind
Tree.Kind getKind()
- Returns:
- the kind of this tree
accept
<R, D> R accept(TreeVisitor<R,D> visitor, D data)
- Type Parameters:
R
- the result type of this operationD
- the type of additional data- Parameters:
visitor
- the visitor to be calleddata
- a value to be passed to the visitor- Returns:
- the result returned from calling the visitor
© 1993, 2023, 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/21/docs/api/jdk.compiler/com/sun/source/tree/Tree.html