Compiler Tree API

Interface Tree

All Known Subinterfaces:
AnnotationTree, ArrayAccessTree, ArrayTypeTree, AssertTree, AssignmentTree, BinaryTree, BlockTree, BreakTree, CaseTree, CatchTree, ClassTree, CompilationUnitTree, CompoundAssignmentTree, ConditionalExpressionTree, ContinueTree, DoWhileLoopTree, EmptyStatementTree, EnhancedForLoopTree, ErroneousTree, ExpressionStatementTree, ExpressionTree, ForLoopTree, IdentifierTree, IfTree, ImportTree, InstanceOfTree, LabeledStatementTree, LiteralTree, MemberSelectTree, MethodInvocationTree, MethodTree, ModifiersTree, NewArrayTree, NewClassTree, ParameterizedTypeTree, ParenthesizedTree, PrimitiveTypeTree, ReturnTree, StatementTree, SwitchTree, SynchronizedTree, ThrowTree, TryTree, TypeCastTree, TypeParameterTree, UnaryTree, VariableTree, WhileLoopTree, WildcardTree

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 Java™ programming language evolves. These interfaces are implemented by Sun's Java compiler (javac) and should not be implemented either directly or indirectly by other applications.


Nested Class Summary
static class Tree.Kind
          Enumerates all kinds of trees.
Method Summary
<R,D> R
accept(TreeVisitor<R,D> visitor, D data)
          Accept method used to implement the visitor pattern.
 Tree.Kind getKind()
          Gets the kind of this tree.

Method Detail


Tree.Kind getKind()
Gets the kind of this tree.

the kind of this tree.


<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 additonal data.

Compiler Tree API

Submit a bug or feature
Copyright © 2005, 2011, Oracle and/or its affiliates. All rights reserved.