Each subclass is highly standardized. It generally contains only tree fields for the syntactic subcomponents of the node. Some classes that represent identifier uses or definitions also define a Symbol field that denotes the represented identifier. Classes for non-local jumps also carry the jump target as a field. The root class Tree itself defines fields for the tree's type and position. No other fields are kept in a tree node; instead parameters are passed to methods accessing the node.
Except for the methods defined by com.sun.source, the only method defined in subclasses is `visit' which applies a given visitor to the tree. The actual tree processing is done by visitor classes in other packages. The abstract class Visitor, as well as an Factory interface for trees, are defined as inner classes in Tree.
To avoid ambiguities with the Tree API in com.sun.source all sub classes should, by convention, start with JC (javac).
This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
TreeMaker, TreeInfo, TreeTranslator, Pretty
| Modifier and Type | Class and Description |
|---|---|
| public static interface | JCTree.
An interface for tree factories |
| public static class | |
| public static class | |
| public static class | |
| public static class | JCTree.
An array selection |
| public static class | JCTree.
An array type, A[] |
| public static class | JCTree.
An assert statement. |
| public static class | JCTree.
A assignment with "=". |
| public static class | JCTree.
An assignment with "+=", "|=" ... |
| public static class | JCTree.
A binary operation. |
| public static class | |
| public static class | JCTree.
A statement block. |
| public static class | JCTree.
A break from a loop or switch. |
| public static class | JCTree.
A "case :" of a switch. |
| public abstract static class | |
| public static class | JCTree.
A catch block. |
| public static class | JCTree.
A class definition. |
| public static class | JCTree.
Everything in one source file is kept in a JCCompilationUnit structure. |
| public static class | JCTree.
A ( ) ? |
| public static class | |
| public static class | JCTree.
A continue of a loop. |
| public static class | |
| public abstract static class | |
| public static class | JCTree.
A do loop |
| public static class | JCTree.
The enhanced for loop. |
| public static class | |
| public static class | |
| public abstract static class | |
| public static class | JCTree.
an expression statement |
| public static class | JCTree.
Selects through packages and classes |
| public static class | JCTree.
A for loop. |
| public abstract static class | JCTree.
Common supertype for all functional expression trees (lambda and method references) |
| public static class | JCTree.
An identifier |
| public static class | JCTree.
An "if ( ) { } else { }" block |
| public static class | JCTree.
An import clause. |
| public abstract static class | |
| public static class | JCTree.
A type test. |
| public static class | JCTree.
A labelled expression or statement. |
| public static class | JCTree.
A lambda expression. |
| public static class | JCTree.
A constant value given literally. |
| public static class | JCTree.
Selects a member expression. |
| public static class | JCTree.
A method definition. |
| public static class | JCTree.
A method invocation |
| public static class | |
| public static class | |
| public static class | JCTree.
A module import clause. |
| public static class | JCTree.
A new[...] operation. |
| public static class | JCTree.
A new(...) operation. |
| public static class | |
| public abstract static class | |
| public static class | JCTree.
Package definition. |
| public static class | JCTree.
A parenthesized subexpression ( ... |
| public abstract static class | JCTree.
Pattern matching forms. |
| public static class | |
| public abstract static class | JCTree.
Common supertype for all poly expression trees (lambda, method references, conditionals, method and constructor calls) |
| public static class | JCTree.
Identifies a basic type. |
| public static class | |
| public static class | |
| public static class | |
| public static class | JCTree.
A return statement. |
| public static class | JCTree.
A no-op statement ";". |
| public abstract static class | |
| public static class | JCTree.
A "switch ( ) { }" construction. |
| public static class | JCTree.
A "switch ( ) { }" construction. |
| public static class | JCTree.
A synchronized block. |
| public static class | JCTree.
A throw statement. |
| public static class | JCTree.
A "try { } catch ( ) { } finally { }" block. |
| public static class | JCTree.
A parameterized type, T<... |
| public static class | JCTree.
A type cast. |
| public static class | JCTree.
An intersection type, |
| public static class | JCTree.
A formal class parameter. |
| public static class | JCTree.
A union type, T1 | T2 | ... |
| public static class | JCTree.
A unary operation. |
| public static class | |
| public static class | JCTree.
A variable definition. |
| public static class | |
| public static class | JCTree.
A while loop |
| public static class | |
| public static class | JCTree.
A break-with from a switch expression. |
| public static class | JCTree.
(let int x = 3; in x+2) |
| public static enum | |
| public static class | |
| public abstract static class | JCTree.
A generic visitor class for trees. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract void | |
| public abstract <R, D> R | accept(TreeVisitor<R, D> v, D d)
Redeclares com. Accept method used to implement the visitor pattern. |
| public Object | |
| public int | getEndPosition()
Implements com. If there is a tree node, get the end position of the tree node. |
| public int | getPreferredPosition()
Implements com. Get the position within the file that most accurately defines the location for the diagnostic. |
| public int | getStartPosition()
Implements com. If there is a tree node, get the start position of the tree node. |
| public abstract JCTree. | |
| public JCTree | getTree()
Implements com. Gets the tree node, if any, to which the diagnostic applies. |
| public boolean | |
| private int | |
| public JCDiagnostic. | |
| public JCTree | |
| public JCTree | |
| public String |