Modifier and Type | Method and Description |
---|---|
<N extends Node> |
JavaParser.parse(ParseStart<N> start,
Provider provider)
Parses source code.
|
Modifier and Type | Method and Description |
---|---|
Node |
HasParentNode.getParentNodeForChildren()
Returns the parent node from the perspective of the children of this node.
|
Modifier and Type | Method and Description |
---|---|
Optional<Node> |
HasParentNode.getParentNode()
Returns the parent node, or
Optional.empty if no parent is set. |
Modifier and Type | Method and Description |
---|---|
default boolean |
HasParentNode.isDescendantOf(Node ancestor)
Determines whether this
HasParentNode node is a descendant of the given node. |
T |
HasParentNode.setParentNode(Node parentNode)
Sets the parent node.
|
Modifier and Type | Method and Description |
---|---|
void |
Processor.postProcess(ParseResult<? extends Node> result,
ParserConfiguration configuration)
Makes the parser do a post-parsing step before the result is returned to the user.
|
Modifier and Type | Class and Description |
---|---|
class |
NodeList<N extends Node>
A list of nodes.
|
Modifier and Type | Class and Description |
---|---|
class |
ArrayCreationLevel
In
new int[1][2]; there are two ArrayCreationLevel objects,
the first one contains the expression "1",
the second the expression "2". |
class |
CompilationUnit
This class represents the entire compilation unit.
|
class |
ImportDeclaration
An import declaration.
|
class |
Modifier
A modifier, like private, public, or volatile.
|
class |
PackageDeclaration
A package declaration.
|
Modifier and Type | Method and Description |
---|---|
<T extends Node> |
Node.findAll(Class<T> nodeType)
Walks the AST with pre-order traversal, returning all nodes of type "nodeType".
|
<T extends Node> |
Node.findAll(Class<T> nodeType,
Node.TreeTraversal traversal)
Walks the AST with specified traversal order, returning all nodes of type "nodeType".
|
<T extends Node> |
Node.findAll(Class<T> nodeType,
Predicate<T> predicate)
Walks the AST with pre-order traversal, returning all nodes of type "nodeType" that match the predicate.
|
<N extends Node> |
Node.findFirst(Class<N> nodeType)
Walks the AST with pre-order traversal, returning the first node of type "nodeType" or empty() if none is found.
|
<N extends Node> |
Node.findFirst(Class<N> nodeType,
Predicate<N> predicate)
Walks the AST with pre-order traversal, returning the first node of type "nodeType" that matches "predicate" or empty() if none is
found.
|
<N extends Node> |
Node.getChildNodesByType(Class<N> clazz)
Deprecated.
use
findAll(Class) but be aware that findAll also considers the initial node. |
<N extends Node> |
Node.getNodesByType(Class<N> clazz)
Deprecated.
use
findAll(Class) but be aware that findAll also considers the initial node. |
static <X extends Node> |
NodeList.nodeList(Collection<X> nodes) |
static <X extends Node> |
NodeList.nodeList(NodeList<X> nodes) |
static <X extends Node> |
NodeList.nodeList(X... nodes) |
static <T extends Node> |
NodeList.toNodeList() |
<T extends Node> |
Node.walk(Class<T> nodeType,
Consumer<T> consumer)
Walks the AST with pre-order traversal, calling the consumer for every node of type "nodeType".
|
Modifier and Type | Method and Description |
---|---|
Node |
Node.clone() |
Node |
Node.findRootNode()
Finds the root node of this AST by finding the topmost parent.
|
Node |
NodeList.getParentNodeForChildren() |
Node |
Node.getParentNodeForChildren() |
Node |
Node.BreadthFirstIterator.next() |
Node |
Node.DirectChildrenIterator.next() |
Node |
Node.ParentsVisitor.next() |
Node |
Node.PreOrderIterator.next() |
Node |
Node.PostOrderIterator.next() |
Node |
Node.removeComment() |
Node |
Node.setBlockComment(String comment)
Use this to store additional information to this node.
|
Node |
Node.setComment(Comment comment)
Use this to store additional information to this node.
|
Node |
Node.setLineComment(String comment)
Use this to store additional information to this node.
|
Node |
Node.setParentNode(Node newParentNode)
Assign a new parent to this node, removing it
from the list of children of the previous parent, if any.
|
Node |
Node.setParsed(Node.Parsedness parsed)
Used by the parser to flag unparsable nodes.
|
Node |
Node.setRange(Range range) |
Node |
Node.setTokenRange(TokenRange tokenRange) |
Modifier and Type | Method and Description |
---|---|
List<Node> |
Node.getChildNodes()
Contains all nodes that have this node set as their parent.
|
Optional<Node> |
NodeList.getParentNode() |
Optional<Node> |
Node.getParentNode() |
Stream<Node> |
Node.stream()
Make a stream of nodes using pre-order traversal.
|
Stream<Node> |
Node.stream(Node.TreeTraversal traversal)
Make a stream of nodes using traversal algorithm "traversal".
|
Modifier and Type | Method and Description |
---|---|
boolean |
Node.isAncestorOf(Node descendant)
Determines whether this node is an ancestor of the given node.
|
static <X extends Node> |
NodeList.nodeList(X... nodes) |
boolean |
PackageDeclaration.remove(Node node) |
boolean |
NodeList.remove(Node node) |
boolean |
Node.remove(Node node) |
boolean |
CompilationUnit.remove(Node node) |
boolean |
ArrayCreationLevel.remove(Node node) |
boolean |
Node.replace(Node node)
Try to replace this node in the parent with the supplied node.
|
boolean |
PackageDeclaration.replace(Node node,
Node replacementNode) |
boolean |
Node.replace(Node node,
Node replacementNode) |
boolean |
ImportDeclaration.replace(Node node,
Node replacementNode) |
boolean |
CompilationUnit.replace(Node node,
Node replacementNode) |
boolean |
ArrayCreationLevel.replace(Node node,
Node replacementNode) |
protected void |
Node.setAsParentNodeOf(Node childNode) |
NodeList<N> |
NodeList.setParentNode(Node parentNode)
Sets the parentNode
|
Node |
Node.setParentNode(Node newParentNode)
Assign a new parent to this node, removing it
from the list of children of the previous parent, if any.
|
Modifier and Type | Method and Description |
---|---|
<T> Optional<T> |
Node.findFirst(Node.TreeTraversal traversal,
Function<Node,Optional<T>> consumer)
Walks the AST, applying the function for every node, with traversal algorithm "traversal".
|
protected void |
Node.setAsParentNodeOf(NodeList<? extends Node> list) |
void |
Node.walk(Consumer<Node> consumer)
Walks the AST, calling the consumer for every node with pre-order traversal.
|
void |
Node.walk(Node.TreeTraversal traversal,
Consumer<Node> consumer)
Walks the AST, calling the consumer for every node, with traversal algorithm "traversal".
|
Constructor and Description |
---|
BreadthFirstIterator(Node node) |
DirectChildrenIterator(Node node) |
NodeList(N... n) |
ParentsVisitor(Node node) |
PostOrderIterator(Node root) |
PreOrderIterator(Node node) |
Modifier and Type | Class and Description |
---|---|
class |
AnnotationDeclaration
An annotation type declaration.
|
class |
AnnotationMemberDeclaration
The "int id();" in
@interface X { int id(); }
All annotations preceding the type will be set on this object, not on the type. |
class |
BodyDeclaration<T extends BodyDeclaration<?>>
Any declaration that can appear between the { and } of a class, interface, enum, or record.
|
class |
CallableDeclaration<T extends CallableDeclaration<?>>
Represents a declaration which is callable eg. a method or a constructor.
|
class |
ClassOrInterfaceDeclaration
A definition of a class or interface.
|
class |
CompactConstructorDeclaration
The record declaration's constructor
WARNING: This implementation is subject to change.
|
class |
ConstructorDeclaration
A constructor declaration:
class X { X() { } } where X(){} is the constructor declaration. |
class |
EnumConstantDeclaration
One of the values an enum can take.
|
class |
EnumDeclaration
The declaration of an enum.
|
class |
FieldDeclaration
The declaration of a field in a class.
|
class |
InitializerDeclaration
A (possibly static) initializer body.
|
class |
MethodDeclaration
A method declaration.
|
class |
Parameter
The parameters to a method or lambda.
|
class |
ReceiverParameter
The receiver parameter feature of Java.
|
class |
RecordDeclaration
The record declaration
WARNING: This implementation is subject to change.
|
class |
TypeDeclaration<T extends TypeDeclaration<?>>
A base class for all types of type declarations.
|
class |
VariableDeclarator
The declaration of a variable.
|
Modifier and Type | Method and Description |
---|---|
boolean |
VariableDeclarator.remove(Node node) |
boolean |
TypeDeclaration.remove(Node node) |
boolean |
RecordDeclaration.remove(Node node) |
boolean |
ReceiverParameter.remove(Node node) |
boolean |
Parameter.remove(Node node) |
boolean |
MethodDeclaration.remove(Node node) |
boolean |
FieldDeclaration.remove(Node node) |
boolean |
EnumDeclaration.remove(Node node) |
boolean |
EnumConstantDeclaration.remove(Node node) |
boolean |
CompactConstructorDeclaration.remove(Node node) |
boolean |
ClassOrInterfaceDeclaration.remove(Node node) |
boolean |
CallableDeclaration.remove(Node node) |
boolean |
BodyDeclaration.remove(Node node) |
boolean |
AnnotationMemberDeclaration.remove(Node node) |
boolean |
VariableDeclarator.replace(Node node,
Node replacementNode) |
boolean |
TypeDeclaration.replace(Node node,
Node replacementNode) |
boolean |
RecordDeclaration.replace(Node node,
Node replacementNode) |
boolean |
ReceiverParameter.replace(Node node,
Node replacementNode) |
boolean |
Parameter.replace(Node node,
Node replacementNode) |
boolean |
MethodDeclaration.replace(Node node,
Node replacementNode) |
boolean |
InitializerDeclaration.replace(Node node,
Node replacementNode) |
boolean |
FieldDeclaration.replace(Node node,
Node replacementNode) |
boolean |
EnumDeclaration.replace(Node node,
Node replacementNode) |
boolean |
EnumConstantDeclaration.replace(Node node,
Node replacementNode) |
boolean |
ConstructorDeclaration.replace(Node node,
Node replacementNode) |
boolean |
CompactConstructorDeclaration.replace(Node node,
Node replacementNode) |
boolean |
ClassOrInterfaceDeclaration.replace(Node node,
Node replacementNode) |
boolean |
CallableDeclaration.replace(Node node,
Node replacementNode) |
boolean |
BodyDeclaration.replace(Node node,
Node replacementNode) |
boolean |
AnnotationMemberDeclaration.replace(Node node,
Node replacementNode) |
Modifier and Type | Class and Description |
---|---|
class |
BlockComment
AST node that represent block comments.
|
class |
Comment
Abstract class for all AST nodes that represent comments.
|
class |
JavadocComment
A Javadoc comment.
|
class |
LineComment
AST node that represent line comments.
|
Modifier and Type | Method and Description |
---|---|
Node |
Comment.findRootNode() |
Node |
Comment.setComment(Comment comment) |
Modifier and Type | Method and Description |
---|---|
Optional<Node> |
Comment.getCommentedNode() |
Modifier and Type | Method and Description |
---|---|
Comment |
Comment.setCommentedNode(Node commentedNode)
Sets the commentedNode
|
Modifier and Type | Class and Description |
---|---|
class |
AnnotationExpr
A base class for the different types of annotations.
|
class |
ArrayAccessExpr
Array brackets [] being used to get a value from an array.
|
class |
ArrayCreationExpr
new int[5][4][][] or new int[][]{{1},{2,3}} . |
class |
ArrayInitializerExpr
The initialization of an array.
|
class |
AssignExpr
An assignment expression.
|
class |
BinaryExpr
An expression with an expression on the left, an expression on the right, and an operator in the middle.
|
class |
BooleanLiteralExpr
The boolean literals.
|
class |
CastExpr
A typecast.
|
class |
CharLiteralExpr
A literal character.
|
class |
ClassExpr
Defines an expression that accesses the class of a type.
|
class |
ConditionalExpr
The ternary conditional expression.
|
class |
DoubleLiteralExpr
A float or a double constant.
|
class |
EnclosedExpr
An expression between ( ).
|
class |
Expression
A base class for all expressions.
|
class |
FieldAccessExpr
Access of a field of an object or a class.
|
class |
InstanceOfExpr
The instanceof statement
Java ??
|
class |
IntegerLiteralExpr
All ways to specify an int literal.
|
class |
LambdaExpr
A lambda expression
Java 1-7
Does not exist.
|
class |
LiteralExpr
A base class for all literal expressions.
|
class |
LiteralStringValueExpr
Any literal value that is stored internally as a String.
|
class |
LongLiteralExpr
All ways to specify a long literal.
|
class |
MarkerAnnotationExpr
An annotation that uses only the annotation type name.
|
class |
MemberValuePair
A value for a member of an annotation.
|
class |
MethodCallExpr
A method call on an object or a class.
|
class |
MethodReferenceExpr
Method reference expressions introduced in Java 8 specifically designed to simplify lambda Expressions.
|
class |
Name
A name that may consist of multiple identifiers.
|
class |
NameExpr
Whenever a SimpleName is used in an expression, it is wrapped in NameExpr.
|
class |
NormalAnnotationExpr
An annotation that has zero or more key-value pairs.
|
class |
NullLiteralExpr
A literal "null".
|
class |
ObjectCreationExpr
A constructor call.
|
class |
PatternExpr
The instanceof statement
Java 1.0 to 13
Not available.
|
class |
SimpleName
A name that consists of a single identifier.
|
class |
SingleMemberAnnotationExpr
An annotation that has a single value.
|
class |
StringLiteralExpr
A literal string.
|
class |
SuperExpr
An occurrence of the "super" keyword.
|
class |
SwitchExpr
The switch expression
Java 1.0-11
Not available.
|
class |
TextBlockLiteralExpr
A text block
Java 13-
A text block is a multi-line string.
|
class |
ThisExpr
An occurrence of the "this" keyword.
|
class |
TypeExpr
This class is just instantiated as scopes for MethodReferenceExpr nodes to encapsulate Types.
|
class |
UnaryExpr
An expression where an operator is applied to a single expression.
|
class |
VariableDeclarationExpr
A declaration of variables.
|
Modifier and Type | Field and Description |
---|---|
static Predicate<Node> |
Expression.IS_NOT_ENCLOSED_EXPR
|
Modifier and Type | Method and Description |
---|---|
boolean |
VariableDeclarationExpr.remove(Node node) |
boolean |
ThisExpr.remove(Node node) |
boolean |
SwitchExpr.remove(Node node) |
boolean |
SuperExpr.remove(Node node) |
boolean |
PatternExpr.remove(Node node) |
boolean |
ObjectCreationExpr.remove(Node node) |
boolean |
NormalAnnotationExpr.remove(Node node) |
boolean |
Name.remove(Node node) |
boolean |
MethodReferenceExpr.remove(Node node) |
boolean |
MethodCallExpr.remove(Node node) |
boolean |
LambdaExpr.remove(Node node) |
boolean |
InstanceOfExpr.remove(Node node) |
boolean |
FieldAccessExpr.remove(Node node) |
boolean |
ArrayInitializerExpr.remove(Node node) |
boolean |
ArrayCreationExpr.remove(Node node) |
boolean |
VariableDeclarationExpr.replace(Node node,
Node replacementNode) |
boolean |
UnaryExpr.replace(Node node,
Node replacementNode) |
boolean |
TypeExpr.replace(Node node,
Node replacementNode) |
boolean |
ThisExpr.replace(Node node,
Node replacementNode) |
boolean |
SwitchExpr.replace(Node node,
Node replacementNode) |
boolean |
SuperExpr.replace(Node node,
Node replacementNode) |
boolean |
SingleMemberAnnotationExpr.replace(Node node,
Node replacementNode) |
boolean |
PatternExpr.replace(Node node,
Node replacementNode) |
boolean |
ObjectCreationExpr.replace(Node node,
Node replacementNode) |
boolean |
NormalAnnotationExpr.replace(Node node,
Node replacementNode) |
boolean |
NameExpr.replace(Node node,
Node replacementNode) |
boolean |
Name.replace(Node node,
Node replacementNode) |
boolean |
MethodReferenceExpr.replace(Node node,
Node replacementNode) |
boolean |
MethodCallExpr.replace(Node node,
Node replacementNode) |
boolean |
MemberValuePair.replace(Node node,
Node replacementNode) |
boolean |
LambdaExpr.replace(Node node,
Node replacementNode) |
boolean |
InstanceOfExpr.replace(Node node,
Node replacementNode) |
boolean |
FieldAccessExpr.replace(Node node,
Node replacementNode) |
boolean |
EnclosedExpr.replace(Node node,
Node replacementNode) |
boolean |
ConditionalExpr.replace(Node node,
Node replacementNode) |
boolean |
ClassExpr.replace(Node node,
Node replacementNode) |
boolean |
CastExpr.replace(Node node,
Node replacementNode) |
boolean |
BinaryExpr.replace(Node node,
Node replacementNode) |
boolean |
AssignExpr.replace(Node node,
Node replacementNode) |
boolean |
ArrayInitializerExpr.replace(Node node,
Node replacementNode) |
boolean |
ArrayCreationExpr.replace(Node node,
Node replacementNode) |
boolean |
ArrayAccessExpr.replace(Node node,
Node replacementNode) |
boolean |
AnnotationExpr.replace(Node node,
Node replacementNode) |
Modifier and Type | Class and Description |
---|---|
class |
ModuleDeclaration
A Java 9 Jigsaw module declaration.
|
class |
ModuleDirective
A module directive.
|
class |
ModuleExportsDirective
An exports directive in module-info.java.
|
class |
ModuleOpensDirective
An opens directive in module-info.java.
|
class |
ModuleProvidesDirective
A provides directive in module-info.java.
|
class |
ModuleRequiresDirective
A require directive in module-info.java.
|
class |
ModuleUsesDirective
A uses directive in module-info.java.
|
Modifier and Type | Method and Description |
---|---|
boolean |
ModuleRequiresDirective.remove(Node node) |
boolean |
ModuleProvidesDirective.remove(Node node) |
boolean |
ModuleOpensDirective.remove(Node node) |
boolean |
ModuleExportsDirective.remove(Node node) |
boolean |
ModuleDeclaration.remove(Node node) |
boolean |
ModuleUsesDirective.replace(Node node,
Node replacementNode) |
boolean |
ModuleRequiresDirective.replace(Node node,
Node replacementNode) |
boolean |
ModuleProvidesDirective.replace(Node node,
Node replacementNode) |
boolean |
ModuleOpensDirective.replace(Node node,
Node replacementNode) |
boolean |
ModuleExportsDirective.replace(Node node,
Node replacementNode) |
boolean |
ModuleDeclaration.replace(Node node,
Node replacementNode) |
Modifier and Type | Interface and Description |
---|---|
interface |
NodeWithAnnotations<N extends Node>
A node that can be annotated.
|
interface |
NodeWithArguments<N extends Node>
A node with arguments.
|
interface |
NodeWithBlockStmt<N extends Node>
A node with a body that is a BlockStmt.
|
interface |
NodeWithBody<N extends Node> |
interface |
NodeWithCondition<N extends Node> |
interface |
NodeWithExpression<N extends Node>
A node that has an expression in it.
|
interface |
NodeWithExtends<N extends Node>
A node that explicitly extends other types, using the
extends keyword. |
interface |
NodeWithIdentifier<N extends Node> |
interface |
NodeWithImplements<N extends Node>
A node that implements other types.
|
interface |
NodeWithJavadoc<N extends Node>
A node that can be documented with a Javadoc comment.
|
interface |
NodeWithMembers<N extends Node>
A node having members.
|
interface |
NodeWithModifiers<N extends Node>
A Node with Modifiers.
|
interface |
NodeWithName<N extends Node>
A node with a (qualified) name.
|
interface |
NodeWithOptionalBlockStmt<N extends Node>
A node with a body that is a BlockStmt, which is optional.
|
interface |
NodeWithOptionalLabel<T extends Node>
A node that has an optional label.
|
interface |
NodeWithOptionalScope<N extends Node>
Represents a node which has an optional scope expression eg. method calls (object.method()).
|
interface |
NodeWithParameters<N extends Node> |
interface |
NodeWithScope<N extends Node>
Represents a node which has a required scope expression eg. field access (object.method).
|
interface |
NodeWithSimpleName<N extends Node>
A node with a name.
|
interface |
NodeWithStatements<N extends Node>
A node that contains a list of statements.
|
interface |
NodeWithThrownExceptions<N extends Node>
A node that declares the types of exception it throws.
|
interface |
NodeWithType<N extends Node,T extends Type>
A node with a type.
|
interface |
NodeWithTypeArguments<N extends Node>
A node that can have type arguments.
|
interface |
NodeWithTypeParameters<N extends Node>
A node that can have type parameters.
|
interface |
NodeWithVariables<N extends Node>
A node which has a list of variables.
|
Modifier and Type | Method and Description |
---|---|
Node |
NodeWithJavadoc.setComment(Comment comment) |
Modifier and Type | Method and Description |
---|---|
default boolean |
NodeWithRange.containsWithin(Node other)
Deprecated.
use
NodeWithRange.containsWithinRange(Node) instead. |
default boolean |
NodeWithRange.containsWithinRange(Node other)
Checks whether the range of the given
Node is contained within the range of this NodeWithRange . |
boolean |
SwitchNode.remove(Node node) |
boolean |
SwitchNode.replace(Node node,
Node replacementNode) |
Modifier and Type | Interface and Description |
---|---|
interface |
NodeWithAbstractModifier<N extends Node>
A node that can be abstract.
|
interface |
NodeWithAccessModifiers<N extends Node>
A node that can be public, protected, and/or private.
|
interface |
NodeWithFinalModifier<N extends Node>
A node that can be final.
|
interface |
NodeWithPrivateModifier<N extends Node>
A node that can be private.
|
interface |
NodeWithProtectedModifier<N extends Node>
A node that can be protected.
|
interface |
NodeWithPublicModifier<N extends Node>
A node that can be public.
|
interface |
NodeWithStaticModifier<N extends Node>
A node that can be static.
|
interface |
NodeWithStrictfpModifier<N extends Node>
A node that can be strictfp.
|
Modifier and Type | Method and Description |
---|---|
Node |
ObservableProperty.getValueAsSingleReference(Node node) |
Modifier and Type | Method and Description |
---|---|
NodeList<? extends Node> |
ObservableProperty.getValueAsMultipleReference(Node node) |
Modifier and Type | Method and Description |
---|---|
void |
PropagatingAstObserver.concreteListChange(NodeList<?> observedNode,
AstObserver.ListChangeType type,
int index,
Node nodeAddedOrRemoved) |
void |
PropagatingAstObserver.concreteListReplacement(NodeList<?> observedNode,
int index,
Node oldValue,
Node newValue) |
void |
PropagatingAstObserver.concretePropertyChange(Node observedNode,
ObservableProperty property,
Object oldValue,
Object newValue) |
Object |
ObservableProperty.getRawValue(Node node) |
Boolean |
ObservableProperty.getValueAsBooleanAttribute(Node node) |
Collection<?> |
ObservableProperty.getValueAsCollection(Node node) |
NodeList<? extends Node> |
ObservableProperty.getValueAsMultipleReference(Node node) |
Node |
ObservableProperty.getValueAsSingleReference(Node node) |
String |
ObservableProperty.getValueAsStringAttribute(Node node) |
boolean |
ObservableProperty.isNull(Node node) |
boolean |
ObservableProperty.isNullOrEmpty(Node node) |
boolean |
ObservableProperty.isNullOrNotPresent(Node node) |
void |
PropagatingAstObserver.listChange(NodeList<?> observedNode,
AstObserver.ListChangeType type,
int index,
Node nodeAddedOrRemoved) |
void |
AstObserverAdapter.listChange(NodeList<?> observedNode,
AstObserver.ListChangeType type,
int index,
Node nodeAddedOrRemoved) |
void |
AstObserver.listChange(NodeList<?> observedNode,
AstObserver.ListChangeType type,
int index,
Node nodeAddedOrRemoved)
A list is changed
|
void |
PropagatingAstObserver.listReplacement(NodeList<?> observedNode,
int index,
Node oldNode,
Node newNode) |
void |
AstObserverAdapter.listReplacement(NodeList<?> observedNode,
int index,
Node oldNode,
Node newNode) |
void |
AstObserver.listReplacement(NodeList<?> observedNode,
int index,
Node oldNode,
Node newNode) |
void |
PropagatingAstObserver.parentChange(Node observedNode,
Node previousParent,
Node newParent) |
void |
AstObserverAdapter.parentChange(Node observedNode,
Node previousParent,
Node newParent) |
void |
AstObserver.parentChange(Node observedNode,
Node previousParent,
Node newParent)
The parent of a node is changed
|
void |
PropagatingAstObserver.propertyChange(Node observedNode,
ObservableProperty property,
Object oldValue,
Object newValue) |
void |
AstObserverAdapter.propertyChange(Node observedNode,
ObservableProperty property,
Object oldValue,
Object newValue) |
void |
AstObserver.propertyChange(Node observedNode,
ObservableProperty property,
Object oldValue,
Object newValue)
The value of a property is changed
|
Modifier and Type | Class and Description |
---|---|
class |
AssertStmt
A usage of the keyword "assert"
In assert dead : "Wasn't expecting to be dead here"; the check is "dead" and the message is the string. |
class |
BlockStmt
Statements in between { and }.
|
class |
BreakStmt
The break statement
Java 1.0-11
Break has an optional label:
break;
break somewhere;
The label is in the "value" property as a NameExpr. |
class |
CatchClause
The catch part of a try-catch-finally.
|
class |
ContinueStmt
A continue statement with an optional label;
continue brains;
continue; |
class |
DoStmt
A do-while.
|
class |
EmptyStmt
An empty statement is a ";" where a statement is expected.
|
class |
ExplicitConstructorInvocationStmt
A call to super or this in a constructor or initializer.
|
class |
ExpressionStmt
Used to wrap an expression so that it can take the place of a statement.
|
class |
ForEachStmt
A for-each statement.
|
class |
ForStmt
The classic for statement
Examples:
for(int a=3, b=5; a<99; a++, b++) hello();
for(a=3, b=5; a<99; a++) { hello(); }
for(a(),b();;) hello();
initialization is a list of expressions. |
class |
IfStmt
An if-then-else statement.
|
class |
LabeledStmt
A statement that is labeled, like
label123: println("continuing"); |
class |
LocalClassDeclarationStmt
A class declaration inside a method.
|
class |
LocalRecordDeclarationStmt
A record declaration inside a method.
|
class |
ReturnStmt
The return statement, with an optional expression to return.
|
class |
Statement
A base class for all statements.
|
class |
SwitchEntry
One case in a switch statement
The main Javadoc is in
SwitchStmt
Java 1.0-11
switch (i) {
case 1:
case 2:
System.out.println(444);
break;
default:
System.out.println(0);
}
This contains three SwitchEntrys. |
class |
SwitchStmt
The switch statement
Java 1.0-1.4
The basic C-like switch statement.
|
class |
SynchronizedStmt
Usage of the synchronized keyword.
|
class |
ThrowStmt
Usage of the throw statement.
|
class |
TryStmt
The try statement
Java 1.0-6
try {
// ...
} catch (IOException e) {
// ...
} finally {
// ...
}
In this code, "// do things" is the content of the tryBlock, there is one catch clause that catches IOException e,
and there is a finally block.
|
class |
UnparsableStmt
A statement that had parse errors.
|
class |
WhileStmt
A while statement.
|
class |
YieldStmt
The yield statement
Java 1.0-11
Does not exist.
|
Modifier and Type | Method and Description |
---|---|
boolean |
TryStmt.remove(Node node) |
boolean |
SwitchStmt.remove(Node node) |
boolean |
SwitchEntry.remove(Node node) |
boolean |
ReturnStmt.remove(Node node) |
boolean |
IfStmt.remove(Node node) |
boolean |
ForStmt.remove(Node node) |
boolean |
ExplicitConstructorInvocationStmt.remove(Node node) |
boolean |
ContinueStmt.remove(Node node) |
boolean |
BreakStmt.remove(Node node) |
boolean |
BlockStmt.remove(Node node) |
boolean |
AssertStmt.remove(Node node) |
boolean |
YieldStmt.replace(Node node,
Node replacementNode) |
boolean |
WhileStmt.replace(Node node,
Node replacementNode) |
boolean |
TryStmt.replace(Node node,
Node replacementNode) |
boolean |
ThrowStmt.replace(Node node,
Node replacementNode) |
boolean |
SynchronizedStmt.replace(Node node,
Node replacementNode) |
boolean |
SwitchStmt.replace(Node node,
Node replacementNode) |
boolean |
SwitchEntry.replace(Node node,
Node replacementNode) |
boolean |
ReturnStmt.replace(Node node,
Node replacementNode) |
boolean |
LocalRecordDeclarationStmt.replace(Node node,
Node replacementNode) |
boolean |
LocalClassDeclarationStmt.replace(Node node,
Node replacementNode) |
boolean |
LabeledStmt.replace(Node node,
Node replacementNode) |
boolean |
IfStmt.replace(Node node,
Node replacementNode) |
boolean |
ForStmt.replace(Node node,
Node replacementNode) |
boolean |
ForEachStmt.replace(Node node,
Node replacementNode) |
boolean |
ExpressionStmt.replace(Node node,
Node replacementNode) |
boolean |
ExplicitConstructorInvocationStmt.replace(Node node,
Node replacementNode) |
boolean |
DoStmt.replace(Node node,
Node replacementNode) |
boolean |
ContinueStmt.replace(Node node,
Node replacementNode) |
boolean |
CatchClause.replace(Node node,
Node replacementNode) |
boolean |
BreakStmt.replace(Node node,
Node replacementNode) |
boolean |
BlockStmt.replace(Node node,
Node replacementNode) |
boolean |
AssertStmt.replace(Node node,
Node replacementNode) |
Modifier and Type | Class and Description |
---|---|
class |
ArrayType
To indicate that a type is an array, it gets wrapped in an ArrayType for every array level it has.
|
class |
ClassOrInterfaceType
A class or an interface type.
|
class |
IntersectionType
Represents a set of types.
|
class |
PrimitiveType
A primitive type.
|
class |
ReferenceType
Base class for reference types.
|
class |
Type
Base class for types.
|
class |
TypeParameter
A type parameter.
|
class |
UnionType
The union type
Represents a set of types.
|
class |
UnknownType
An unknown parameter type object.
|
class |
VarType
A type called "var" waiting for Java to infer it.
|
class |
VoidType
The return type of a
MethodDeclaration
when it returns void. |
class |
WildcardType
A wildcard type argument.
|
Modifier and Type | Method and Description |
---|---|
boolean |
WildcardType.remove(Node node) |
boolean |
UnionType.remove(Node node) |
boolean |
TypeParameter.remove(Node node) |
boolean |
Type.remove(Node node) |
boolean |
IntersectionType.remove(Node node) |
boolean |
ClassOrInterfaceType.remove(Node node) |
boolean |
WildcardType.replace(Node node,
Node replacementNode) |
boolean |
UnionType.replace(Node node,
Node replacementNode) |
boolean |
TypeParameter.replace(Node node,
Node replacementNode) |
boolean |
Type.replace(Node node,
Node replacementNode) |
boolean |
IntersectionType.replace(Node node,
Node replacementNode) |
boolean |
ClassOrInterfaceType.replace(Node node,
Node replacementNode) |
boolean |
ArrayType.replace(Node node,
Node replacementNode) |
Modifier and Type | Class and Description |
---|---|
class |
SimpleValidator<N extends Node>
Runs a validator on all nodes of a certain type,
and adds a problem for all nodes that pass a condition.
|
class |
SingleNodeTypeValidator<N extends Node>
Runs a validator on all nodes of a certain type.
|
interface |
TypedValidator<N extends Node>
A validator that validates a known node type.
|
Modifier and Type | Method and Description |
---|---|
void |
VisitorValidator.accept(Node node,
ProblemReporter problemReporter) |
void |
Validators.accept(Node node,
ProblemReporter problemReporter) |
void |
Validator.accept(Node node,
ProblemReporter problemReporter) |
void |
TreeVisitorValidator.accept(Node node,
ProblemReporter reporter) |
void |
SingleNodeTypeValidator.accept(Node node,
ProblemReporter problemReporter) |
Modifier and Type | Method and Description |
---|---|
void |
PostProcessors.postProcess(ParseResult<? extends Node> result,
ParserConfiguration configuration) |
Modifier and Type | Method and Description |
---|---|
protected <T extends Node> |
CloneVisitor.cloneNode(Optional<T> node,
Object arg) |
protected <T extends Node> |
CloneVisitor.cloneNode(T node,
Object arg) |
Modifier and Type | Method and Description |
---|---|
Node |
ModifierVisitor.visit(ImportDeclaration n,
A arg) |
Node |
CloneVisitor.visit(ImportDeclaration n,
Object arg) |
Modifier and Type | Method and Description |
---|---|
void |
VoidVisitorWithDefaults.defaultAction(Node n,
A arg)
This will be called by every node visit method that is not overridden.
|
R |
GenericVisitorWithDefaults.defaultAction(Node n,
A arg)
This will be called by every node visit method that is not overridden.
|
static boolean |
ObjectIdentityEqualsVisitor.equals(Node n,
Node n2) |
static boolean |
NoCommentEqualsVisitor.equals(Node n,
Node n2) |
static boolean |
EqualsVisitor.equals(Node n,
Node n2) |
static int |
ObjectIdentityHashCodeVisitor.hashCode(Node node) |
static int |
NoCommentHashCodeVisitor.hashCode(Node node) |
static int |
HashCodeVisitor.hashCode(Node node) |
abstract void |
TreeVisitor.process(Node node)
Process the given node.
|
void |
TreeVisitor.visitBreadthFirst(Node node)
https://en.wikipedia.org/wiki/Breadth-first_search
|
void |
TreeVisitor.visitDirectChildren(Node node)
Performs a simple traversal over all nodes that have the passed node as their parent.
|
void |
TreeVisitor.visitLeavesFirst(Node node) |
void |
TreeVisitor.visitPostOrder(Node node)
Performs a post-order node traversal starting with a given node.
|
void |
TreeVisitor.visitPreOrder(Node node)
Performs a pre-order node traversal starting with a given node.
|
Modifier and Type | Method and Description |
---|---|
Node |
BaseNodeMetaModel.construct(Map<String,Object> parameters)
Creates a new node of this type.
|
Modifier and Type | Method and Description |
---|---|
Class<? extends Node> |
BaseNodeMetaModel.getType() |
Modifier and Type | Method and Description |
---|---|
Object |
PropertyMetaModel.getValue(Node node)
Introspects the node to get the value from this field.
|
Modifier and Type | Method and Description |
---|---|
boolean |
BaseNodeMetaModel.is(Class<? extends Node> c) |
boolean |
PropertyMetaModel.is(Class<? extends Node> c,
String fieldName) |
Constructor and Description |
---|
AnnotationExprMetaModel(Optional<BaseNodeMetaModel> superNodeMetaModel,
Class<? extends Node> type,
String name,
String packageName,
boolean isAbstract,
boolean hasWildcard) |
BaseNodeMetaModel(Optional<BaseNodeMetaModel> superNodeMetaModel,
Class<? extends Node> type,
String name,
String packageName,
boolean isAbstract,
boolean hasWildcard) |
BodyDeclarationMetaModel(Optional<BaseNodeMetaModel> superNodeMetaModel,
Class<? extends Node> type,
String name,
String packageName,
boolean isAbstract,
boolean hasWildcard) |
CallableDeclarationMetaModel(Optional<BaseNodeMetaModel> superNodeMetaModel,
Class<? extends Node> type,
String name,
String packageName,
boolean isAbstract,
boolean hasWildcard) |
CommentMetaModel(Optional<BaseNodeMetaModel> superNodeMetaModel,
Class<? extends Node> type,
String name,
String packageName,
boolean isAbstract,
boolean hasWildcard) |
ExpressionMetaModel(Optional<BaseNodeMetaModel> superNodeMetaModel,
Class<? extends Node> type,
String name,
String packageName,
boolean isAbstract,
boolean hasWildcard) |
LiteralExprMetaModel(Optional<BaseNodeMetaModel> superNodeMetaModel,
Class<? extends Node> type,
String name,
String packageName,
boolean isAbstract,
boolean hasWildcard) |
LiteralStringValueExprMetaModel(Optional<BaseNodeMetaModel> superNodeMetaModel,
Class<? extends Node> type,
String name,
String packageName,
boolean isAbstract,
boolean hasWildcard) |
ModuleDirectiveMetaModel(Optional<BaseNodeMetaModel> superNodeMetaModel,
Class<? extends Node> type,
String name,
String packageName,
boolean isAbstract,
boolean hasWildcard) |
NodeMetaModel(Optional<BaseNodeMetaModel> superNodeMetaModel,
Class<? extends Node> type,
String name,
String packageName,
boolean isAbstract,
boolean hasWildcard) |
ReferenceTypeMetaModel(Optional<BaseNodeMetaModel> superNodeMetaModel,
Class<? extends Node> type,
String name,
String packageName,
boolean isAbstract,
boolean hasWildcard) |
StatementMetaModel(Optional<BaseNodeMetaModel> superNodeMetaModel,
Class<? extends Node> type,
String name,
String packageName,
boolean isAbstract,
boolean hasWildcard) |
TypeDeclarationMetaModel(Optional<BaseNodeMetaModel> superNodeMetaModel,
Class<? extends Node> type,
String name,
String packageName,
boolean isAbstract,
boolean hasWildcard) |
TypeMetaModel(Optional<BaseNodeMetaModel> superNodeMetaModel,
Class<? extends Node> type,
String name,
String packageName,
boolean isAbstract,
boolean hasWildcard) |
Modifier and Type | Method and Description |
---|---|
static String |
ConcreteSyntaxModel.genericPrettyPrint(Node node) |
static void |
ConcreteSyntaxModel.genericPrettyPrint(Node node,
SourcePrinter printer) |
String |
YamlPrinter.output(Node node) |
String |
XmlPrinter.output(Node node) |
String |
DotPrinter.output(Node node) |
void |
YamlPrinter.output(Node node,
String name,
int level,
StringBuilder builder) |
void |
XmlPrinter.output(Node node,
String name,
int level,
StringBuilder builder) |
void |
DotPrinter.output(Node node,
String parentNodeName,
String name,
StringBuilder builder) |
static void |
YamlPrinter.print(Node node) |
static void |
XmlPrinter.print(Node node) |
String |
Printer.print(Node node) |
String |
PrettyPrinter.print(Node node)
Deprecated.
|
String |
DefaultPrettyPrinter.print(Node node) |
Modifier and Type | Method and Description |
---|---|
static CsmElement |
ConcreteSyntaxModel.forClass(Class<? extends Node> nodeClazz) |
Modifier and Type | Method and Description |
---|---|
int |
CsmAttribute.getTokenType(Node node,
String text,
String tokenText)
Obtain the token type corresponding to the specific value of the attribute.
|
void |
CsmUnindent.prettyPrint(Node node,
SourcePrinter printer) |
void |
CsmToken.prettyPrint(Node node,
SourcePrinter printer) |
void |
CsmTextBlock.prettyPrint(Node node,
SourcePrinter printer) |
void |
CsmString.prettyPrint(Node node,
SourcePrinter printer) |
void |
CsmSingleReference.prettyPrint(Node node,
SourcePrinter printer) |
void |
CsmSequence.prettyPrint(Node node,
SourcePrinter printer) |
void |
CsmOrphanCommentsEnding.prettyPrint(Node node,
SourcePrinter printer) |
void |
CsmNone.prettyPrint(Node node,
SourcePrinter printer) |
void |
CsmMix.prettyPrint(Node node,
SourcePrinter printer) |
void |
CsmList.prettyPrint(Node node,
SourcePrinter printer) |
void |
CsmIndent.prettyPrint(Node node,
SourcePrinter printer) |
void |
CsmElement.prettyPrint(Node node,
SourcePrinter printer) |
void |
CsmConditional.prettyPrint(Node node,
SourcePrinter printer) |
void |
CsmComment.prettyPrint(Node node,
SourcePrinter printer) |
void |
CsmChar.prettyPrint(Node node,
SourcePrinter printer) |
void |
CsmAttribute.prettyPrint(Node node,
SourcePrinter printer) |
Modifier and Type | Method and Description |
---|---|
static <N extends Node> |
LexicalPreservingPrinter.setup(N node)
Prepares the node so it can be used in the print methods.
|
Modifier and Type | Method and Description |
---|---|
Node |
Removed.getChild() |
Node |
ChildTextElement.getChild() |
Modifier and Type | Method and Description |
---|---|
static boolean |
LexicalPreservingPrinter.isAvailableOn(Node node) |
boolean |
ChildTextElement.isNode(Node node) |
static String |
LexicalPreservingPrinter.print(Node node)
Print a Node into a String, preserving the lexical information.
|
Modifier and Type | Method and Description |
---|---|
boolean |
TokenTextElement.isChildOfClass(Class<? extends Node> nodeClass) |
abstract boolean |
TextElement.isChildOfClass(Class<? extends Node> nodeClass)
Is this TextElement representing a child of the given class?
|
boolean |
ChildTextElement.isChildOfClass(Class<? extends Node> nodeClass) |
Modifier and Type | Method and Description |
---|---|
default boolean |
Change.evaluate(CsmConditional csmConditional,
Node node) |
Object |
PropertyChange.getValue(ObservableProperty property,
Node node) |
Object |
NoChange.getValue(ObservableProperty property,
Node node) |
Object |
ListReplacementChange.getValue(ObservableProperty property,
Node node) |
Object |
ListRemovalChange.getValue(ObservableProperty property,
Node node) |
Object |
ListAdditionChange.getValue(ObservableProperty property,
Node node) |
Object |
Change.getValue(ObservableProperty property,
Node node) |
Constructor and Description |
---|
ListAdditionChange(ObservableProperty observableProperty,
int index,
Node nodeAdded) |
ListReplacementChange(ObservableProperty observableProperty,
int index,
Node newValue) |
Modifier and Type | Method and Description |
---|---|
static <N extends Node> |
Navigator.demandNodeOfGivenClass(Node node,
Class<N> clazz) |
static <N extends Node> |
Navigator.findNodeOfGivenClass(Node node,
Class<N> clazz)
Deprecated.
|
<N extends Node> |
Context.getWrappedNode()
Returns the node wrapped in the context
|
Modifier and Type | Method and Description |
---|---|
static Node |
Navigator.demandParentNode(Node node) |
static Node |
Navigator.demandParentNode(Node node,
Predicate<Node> isAcceptedParentNode)
Traverses the parent chain starting at
node and returns the
first Node that returns make isAcceptedParentNode evaluate to
true . |
static Node |
Navigator.requireParentNode(Node node)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static <N extends Node> |
Navigator.demandNodeOfGivenClass(Node node,
Class<N> clazz) |
static Node |
Navigator.demandParentNode(Node node) |
static Node |
Navigator.demandParentNode(Node node,
Predicate<Node> isAcceptedParentNode)
Traverses the parent chain starting at
node and returns the
first Node that returns make isAcceptedParentNode evaluate to
true . |
static SwitchStmt |
Navigator.demandSwitch(Node node) |
static Optional<VariableDeclarator> |
Navigator.demandVariableDeclaration(Node node,
String name) |
default List<ResolvedFieldDeclaration> |
Context.fieldsExposedToChild(Node child)
The fields that are declared and in this immediate context made visible to a given child.
|
static Optional<MethodCallExpr> |
Navigator.findMethodCall(Node node,
String methodName) |
static Optional<NameExpr> |
Navigator.findNameExpression(Node node,
String name) |
static <N extends Node> |
Navigator.findNodeOfGivenClass(Node node,
Class<N> clazz)
Deprecated.
|
static Optional<SimpleName> |
Navigator.findSimpleName(Node node,
String name) |
static SwitchStmt |
Navigator.findSwitch(Node node)
Deprecated.
|
default List<VariableDeclarator> |
Context.localVariablesExposedToChild(Node child)
The local variables that are declared in this immediate context and made visible to a given child.
|
default List<Parameter> |
Context.parametersExposedToChild(Node child)
The parameters that are declared in this immediate context and made visible to a given child.
|
default List<PatternExpr> |
Context.patternExprsExposedToChild(Node child)
The pattern expressions that are declared in this immediate context and made visible to a given child.
|
static Node |
Navigator.requireParentNode(Node node)
Deprecated.
|
<T> T |
SymbolResolver.resolveDeclaration(Node node,
Class<T> resultClass)
For a reference it would find the corresponding declaration.
|
MethodUsage |
Solver.solveMethod(String methodName,
List<ResolvedType> argumentsTypes,
Node node) |
SymbolReference<? extends ResolvedValueDeclaration> |
Solver.solveSymbol(String name,
Node node) |
Optional<Value> |
Solver.solveSymbolAsValue(String name,
Node node) |
SymbolReference<? extends ResolvedTypeDeclaration> |
Solver.solveType(String name,
Node node) |
ResolvedReferenceTypeDeclaration |
SymbolResolver.toTypeDeclaration(Node node)
For a node it would find the corresponding reference type declaration.
|
Modifier and Type | Method and Description |
---|---|
static Node |
Navigator.demandParentNode(Node node,
Predicate<Node> isAcceptedParentNode)
Traverses the parent chain starting at
node and returns the
first Node that returns make isAcceptedParentNode evaluate to
true . |
Modifier and Type | Method and Description |
---|---|
default <N extends Node> |
AssociableToAST.toAst(Class<N> clazz)
If the declaration is associated to an AST node and the type matches the expected
Class return it,
otherwise it returns empty. |
Modifier and Type | Method and Description |
---|---|
default Optional<Node> |
AssociableToAST.toAst()
If the declaration is associated to an AST node return it, otherwise it return empty.
|
Modifier and Type | Class and Description |
---|---|
class |
VisitorList<N extends Node>
A list that overrides the equals and hashcode calculation of the added nodes
by using another equals and hashcode visitor for those methods.
|
class |
VisitorMap<N extends Node,V>
A map that overrides the equals and hashcode calculation of the added nodes
by using another equals and hashcode visitor for those methods.
|
class |
VisitorSet<N extends Node>
A set that overrides the equals and hashcode calculation of the added nodes
by using another equals and hashcode visitor for those methods.
|
Modifier and Type | Method and Description |
---|---|
static <T extends Node> |
PositionUtils.sortByBeginPosition(List<T> nodes) |
static <T extends Node> |
PositionUtils.sortByBeginPosition(List<T> nodes,
boolean ignoringAnnotations) |
static <T extends Node> |
PositionUtils.sortByBeginPosition(NodeList<T> nodes) |
Modifier and Type | Method and Description |
---|---|
static boolean |
PositionUtils.areInOrder(Node a,
Node b) |
static boolean |
PositionUtils.areInOrder(Node a,
Node b,
boolean ignoringAnnotations) |
static AnnotationExpr |
PositionUtils.getLastAnnotation(Node node) |
static boolean |
Utils.hasUnaryMinusAsParent(Node n)
Checks, if the parent is a unary expression with a minus operator.
|
static boolean |
PositionUtils.nodeContains(Node container,
Node other,
boolean ignoringAnnotations)
Compare the position of two nodes.
|
Copyright © 2007–2023. All rights reserved.