Provides interfaces to represent source code as abstract syntax trees (AST).
Interface Summary Interface Description AnnotatedTypeTreeA tree node for an annotated type. AnnotationTreeA tree node for an annotation. ArrayAccessTreeA tree node for an array access expression. ArrayTypeTreeA tree node for an array type. AssertTreeA tree node for an
AssignmentTreeA tree node for an assignment expression. BinaryTreeA tree node for a binary expression. BlockTreeA tree node for a statement block. BreakTreeA tree node for a
CaseTreeA tree node for a
switchstatement or expression.
CatchTreeA tree node for a
catchblock in a
ClassTreeA tree node for a class, interface, enum, or annotation type declaration. CompilationUnitTreeRepresents the abstract syntax tree for compilation units (source files) and package declarations (package-info.java). CompoundAssignmentTreeA tree node for compound assignment operator. ConditionalExpressionTreeA tree node for the conditional operator ? ContinueTreeA tree node for a
DirectiveTreeA super-type for all the directives in a ModuleTree. DoWhileLoopTreeA tree node for a
EmptyStatementTreeA tree node for an empty (skip) statement. EnhancedForLoopTreeA tree node for an "enhanced"
ErroneousTreeA tree node to stand in for a malformed expression. ExportsTreeA tree node for an 'exports' directive in a module declaration. ExpressionStatementTreeA tree node for an expression statement. ExpressionTreeA tree node used as the base class for the different types of expressions. ForLoopTreeA tree node for a basic
IdentifierTreeA tree node for an identifier expression. IfTreeA tree node for an
ImportTreeA tree node for an import declaration. InstanceOfTreeA tree node for an
IntersectionTypeTreeA tree node for an intersection type in a cast expression. LabeledStatementTreeA tree node for a labeled statement. LambdaExpressionTreeA tree node for a lambda expression. LineMapProvides methods to convert between character positions and line numbers for a compilation unit. LiteralTreeA tree node for a literal expression. MemberReferenceTreeA tree node for a member reference expression. MemberSelectTreeA tree node for a member access expression. MethodInvocationTreeA tree node for a method invocation expression. MethodTreeA tree node for a method or annotation type element declaration. ModifiersTreeA tree node for the modifiers, including annotations, for a declaration. ModuleTreeA tree node for a module declaration. NewArrayTreeA tree node for an expression to create a new instance of an array. NewClassTreeA tree node to declare a new instance of a class. OpensTreeA tree node for an 'opens' directive in a module declaration. PackageTreeRepresents the package declaration. ParameterizedTypeTreeA tree node for a type expression involving type parameters. ParenthesizedTreeA tree node for a parenthesized expression. PrimitiveTypeTreeA tree node for a primitive type. ProvidesTreeA tree node for a 'provides' directive in a module declaration. RequiresTreeA tree node for a 'requires' directive in a module declaration. ReturnTreeA tree node for a
ScopeInterface for determining locally available program elements, such as local variables and imports. StatementTreeA tree node used as the base class for the different kinds of statements. SwitchExpressionTree Deprecated, for removal: This API element is subject to removal in a future version.This method is modeling switch expressions, which are part of a preview feature and may be removed if the preview feature is removed. SwitchTreeA tree node for a
SynchronizedTreeA tree node for a
ThrowTreeA tree node for a
TreeCommon interface for all nodes in an abstract syntax tree. TreeVisitor<R,P>A visitor of trees, in the style of the visitor design pattern. TryTreeA tree node for a
TypeCastTreeA tree node for a type cast expression. TypeParameterTreeA tree node for a type parameter. UnaryTreeA tree node for postfix and unary expressions. UnionTypeTreeA tree node for a union type expression in a multicatch variable declaration. UsesTreeA tree node for a 'uses' directive in a module declaration. VariableTreeA tree node for a variable declaration. WhileLoopTreeA tree node for a
WildcardTreeA tree node for a wildcard type argument. YieldTree Deprecated, for removal: This API element is subject to removal in a future version.This class is modeling yield from switch expressions, which are part of a preview feature and may be removed if the preview feature is removed.
Enum Summary Enum Description CaseTree.CaseKind Deprecated, for removal: This API element is subject to removal in a future version.This enum is used to model a rule case, which is part of a preview feature and may be removed if the preview feature is removed. LambdaExpressionTree.BodyKindLambda expressions come in two forms: expression lambdas, whose body is an expression, and statement lambdas, whose body is a block MemberReferenceTree.ReferenceModeThere are two kinds of member references: (i) method references and (ii) constructor references ModuleTree.ModuleKindThe kind of the module. Tree.KindEnumerates all kinds of trees.