| Package | Description | 
|---|---|
| com.sun.source.tree | Provides interfaces to represent source code as abstract syntax
 trees (AST). | 
| com.sun.source.util | Provides utilities for operations on abstract syntax trees (AST). | 
| Modifier and Type | Interface and Description | 
|---|---|
| interface  | AnnotatedTypeTreeA tree node for an annotated type
 For example: | 
| interface  | AnnotationTreeA tree node for an annotation. | 
| interface  | ArrayAccessTreeA tree node for an array access expression. | 
| interface  | ArrayTypeTreeA tree node for an array type. | 
| interface  | AssertTreeA tree node for an 'assert' statement. | 
| interface  | AssignmentTreeA tree node for an assignment expression. | 
| interface  | BinaryTreeA tree node for a binary expression. | 
| interface  | BlockTreeA tree node for a statement block. | 
| interface  | BreakTreeA tree node for a 'break' statement. | 
| interface  | CaseTreeA tree node for a 'case' in a 'switch' statement. | 
| interface  | CatchTreeA tree node for a 'catch' block in a 'try' statement. | 
| interface  | ClassTreeA tree node for a class, interface, enum, or annotation
 type declaration. | 
| interface  | CompilationUnitTreeRepresents the abstract syntax tree for compilation units (source
 files) and package declarations (package-info.java). | 
| interface  | CompoundAssignmentTreeA tree node for compound assignment operator. | 
| interface  | ConditionalExpressionTreeA tree node for the conditional operator ? :. | 
| interface  | ContinueTreeA tree node for a 'continue' statement. | 
| interface  | DoWhileLoopTreeA tree node for a 'do' statement. | 
| interface  | EmptyStatementTreeA tree node for an empty (skip) statement. | 
| interface  | EnhancedForLoopTreeA tree node for an "enhanced" 'for' loop statement. | 
| interface  | ErroneousTreeA tree node to stand in for a malformed expression. | 
| interface  | ExpressionStatementTreeA tree node for an expression statement. | 
| interface  | ExpressionTreeA tree node used as the base class for the different types of
 expressions. | 
| interface  | ForLoopTreeA tree node for a basic 'for' loop statement. | 
| interface  | IdentifierTreeA tree node for an identifier expression. | 
| interface  | IfTreeA tree node for an 'if' statement. | 
| interface  | ImportTreeA tree node for an import statement. | 
| interface  | InstanceOfTreeA tree node for an 'instanceof' expression. | 
| interface  | IntersectionTypeTreeA tree node for an intersection type in a cast expression. | 
| interface  | LabeledStatementTreeA tree node for a labeled statement. | 
| interface  | LambdaExpressionTreeA tree node for a lambda expression. | 
| interface  | LiteralTreeA tree node for a literal expression. | 
| interface  | MemberReferenceTreeA tree node for a member reference expression. | 
| interface  | MemberSelectTreeA tree node for a member access expression. | 
| interface  | MethodInvocationTreeA tree node for a method invocation expression. | 
| interface  | MethodTreeA tree node for a method or annotation type element declaration. | 
| interface  | ModifiersTreeA tree node for the modifiers, including annotations, for a declaration. | 
| interface  | NewArrayTreeA tree node for an expression to create a new instance of an array. | 
| interface  | NewClassTreeA tree node to declare a new instance of a class. | 
| interface  | ParameterizedTypeTreeA tree node for a type expression involving type parameters. | 
| interface  | ParenthesizedTreeA tree node for a parenthesized expression. | 
| interface  | PrimitiveTypeTreeA tree node for a primitive type. | 
| interface  | ReturnTreeA tree node for a 'return' statement. | 
| interface  | StatementTreeA tree node used as the base class for the different kinds of
 statements. | 
| interface  | SwitchTreeA tree node for a 'switch' statement. | 
| interface  | SynchronizedTreeA tree node for a 'synchronized' statement. | 
| interface  | ThrowTreeA tree node for a 'throw' statement. | 
| interface  | TryTreeA tree node for a 'try' statement. | 
| interface  | TypeCastTreeA tree node for a type cast expression. | 
| interface  | TypeParameterTreeA tree node for a type parameter. | 
| interface  | UnaryTreeA tree node for postfix and unary expressions. | 
| interface  | UnionTypeTreeA tree node for a union type expression in a multicatch var declaration. | 
| interface  | VariableTreeA tree node for a variable declaration. | 
| interface  | WhileLoopTreeA tree node for a 'while' loop statement. | 
| interface  | WildcardTreeA tree node for a wildcard type argument. | 
| Modifier and Type | Method and Description | 
|---|---|
| Tree | AnnotationTree. getAnnotationType() | 
| Tree | LambdaExpressionTree. getBody() | 
| Tree | WildcardTree. getBound() | 
| Tree | MethodTree. getDefaultValue() | 
| Tree | ClassTree. getExtendsClause() | 
| Tree | ImportTree. getQualifiedIdentifier() | 
| Tree | MethodTree. getReturnType() | 
| Tree | VariableTree. getType() | 
| Tree | InstanceOfTree. getType() | 
| Tree | TypeCastTree. getType() | 
| Tree | ArrayTypeTree. getType() | 
| Tree | ParameterizedTypeTree. getType() | 
| Tree | NewArrayTree. getType() | 
| Modifier and Type | Method and Description | 
|---|---|
| Class<? extends Tree> | Tree.Kind. asInterface() | 
| List<? extends Tree> | TypeParameterTree. getBounds() | 
| List<? extends Tree> | IntersectionTypeTree. getBounds() | 
| List<? extends Tree> | ErroneousTree. getErrorTrees() | 
| List<? extends Tree> | ClassTree. getImplementsClause() | 
| List<? extends Tree> | ClassTree. getMembers() | 
| List<? extends Tree> | TryTree. getResources() | 
| List<? extends Tree> | UnionTypeTree. getTypeAlternatives() | 
| List<? extends Tree> | ParameterizedTypeTree. getTypeArguments() | 
| List<? extends Tree> | NewClassTree. getTypeArguments() | 
| List<? extends Tree> | MethodInvocationTree. getTypeArguments() | 
| List<? extends Tree> | CompilationUnitTree. getTypeDecls() | 
| Modifier and Type | Method and Description | 
|---|---|
| R | TreeVisitor. visitOther(Tree node,
          P p) | 
| Modifier and Type | Method and Description | 
|---|---|
| Tree | TreePath. getLeaf()Get the leaf node for this path. | 
| abstract Tree | Trees. getTree(Element element)Gets the Tree node for a given Element. | 
| abstract Tree | Trees. getTree(Element e,
       AnnotationMirror a)Gets the Tree node for an AnnotationMirror on a given Element. | 
| abstract Tree | Trees. getTree(Element e,
       AnnotationMirror a,
       AnnotationValue v)Gets the Tree node for an AnnotationValue for an AnnotationMirror on a given Element. | 
| Modifier and Type | Method and Description | 
|---|---|
| Iterator<Tree> | TreePath. iterator()Iterates from leaves to root. | 
| Modifier and Type | Method and Description | 
|---|---|
| protected R | SimpleTreeVisitor. defaultAction(Tree node,
             P p) | 
| long | SourcePositions. getEndPosition(CompilationUnitTree file,
              Tree tree)Gets the ending position of tree within file. | 
| abstract TreePath | Trees. getPath(CompilationUnitTree unit,
       Tree node)Gets the path to tree node within the specified compilation unit. | 
| static TreePath | TreePath. getPath(CompilationUnitTree unit,
       Tree target)Gets a tree path for a tree node within a compilation unit. | 
| static TreePath | TreePath. getPath(TreePath path,
       Tree target)Gets a tree path for a tree node within a subtree identified by a TreePath object. | 
| long | SourcePositions. getStartPosition(CompilationUnitTree file,
                Tree tree)Gets the starting position of tree within file. | 
| abstract void | Trees. printMessage(Diagnostic.Kind kind,
            CharSequence msg,
            Tree t,
            CompilationUnitTree root)Prints a message of the specified kind at the location of the
 tree within the provided compilation unit | 
| R | TreeScanner. scan(Tree node,
    P p)Scan a single node. | 
| R | TreePathScanner. scan(Tree tree,
    P p)Scan a single node. | 
| R | SimpleTreeVisitor. visit(Tree node,
     P p) | 
| R | TreeScanner. visitOther(Tree node,
          P p) | 
| R | SimpleTreeVisitor. visitOther(Tree node,
          P p) | 
| Modifier and Type | Method and Description | 
|---|---|
| abstract TypeMirror | JavacTask. getTypeMirror(Iterable<? extends Tree> path)Get a type mirror of the tree node determined by the specified path. | 
| R | TreeScanner. scan(Iterable<? extends Tree> nodes,
    P p)Scan a list of nodes. | 
| R | SimpleTreeVisitor. visit(Iterable<? extends Tree> nodes,
     P p) | 
| Constructor and Description | 
|---|
| TreePath(TreePath p,
        Tree t)Creates a TreePath for a child node. | 
 Copyright © 2005, 2025, Oracle and/or its affiliates.  All rights reserved.