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()
this for everything except NodeLists.
|
Modifier and Type | Method and Description |
---|---|
Optional<Node> |
HasParentNode.getParentNode()
Return the parent node or null, if no parent is set.
|
Modifier and Type | Method and Description |
---|---|
default void |
HasParentNode.setAsParentNodeOf(Node childNode) |
T |
HasParentNode.setParentNode(Node parentNode)
Set the parent node.
|
Modifier and Type | Method and Description |
---|---|
default void |
HasParentNode.setAsParentNodeOf(List<? extends Node> childNodes) |
Modifier and Type | Class and Description |
---|---|
class |
NodeList<N extends Node>
A list of nodes.
|
Modifier and Type | Class and Description |
---|---|
class |
ArrayBracketPair
Deprecated.
will be removed in 3.0
|
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 |
PackageDeclaration
This class represents the package declaration.
|
Modifier and Type | Field and Description |
---|---|
static Comparator<Node> |
Node.NODE_BY_BEGIN_POSITION
This can be used to sort nodes on position.
|
Modifier and Type | Method and Description |
---|---|
<N extends Node> |
Node.containsWithin(N other) |
<N extends Node> |
Node.getNodesByType(Class<N> clazz)
Recursively finds all nodes of a certain type.
|
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) |
Modifier and Type | Method and Description |
---|---|
Node |
Node.clone() |
Node |
Node.getParentNodeForChildren() |
Node |
NodeList.getParentNodeForChildren() |
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 parentNode)
Assign a new parent to this node, removing it
from the list of children of the previous parent, if any.
|
Node |
Node.setRange(Range range) |
Modifier and Type | Method and Description |
---|---|
List<Node> |
Node.getChildNodes()
Contains all nodes that have this node set as their parent.
|
Optional<Node> |
Node.getParentNode() |
Optional<Node> |
NodeList.getParentNode() |
Modifier and Type | Method and Description |
---|---|
static <X extends Node> |
NodeList.nodeList(X... nodes) |
boolean |
NodeList.remove(Node node) |
Node |
Node.setParentNode(Node parentNode)
Assign a new parent to this node, removing it
from the list of children of the previous parent, if any.
|
NodeList<N> |
NodeList.setParentNode(Node parentNode)
Sets the parentNode
|
Modifier and Type | Method and Description |
---|---|
protected void |
Node.setAsParentNodeOf(NodeList<? extends Node> list) |
Constructor and Description |
---|
NodeList(Node parent) |
Modifier and Type | Class and Description |
---|---|
class |
BodyDeclaration<T extends Node> |
class |
TypeDeclaration<T extends Node> |
Modifier and Type | Class and Description |
---|---|
class |
AnnotationDeclaration |
class |
AnnotationMemberDeclaration |
class |
BodyDeclaration<T extends Node> |
class |
ClassOrInterfaceDeclaration |
class |
ConstructorDeclaration |
class |
EmptyMemberDeclaration |
class |
EmptyTypeDeclaration |
class |
EnumConstantDeclaration |
class |
EnumDeclaration |
class |
FieldDeclaration |
class |
InitializerDeclaration |
class |
MethodDeclaration |
class |
Parameter |
class |
TypeDeclaration<T extends Node> |
class |
VariableDeclarator |
class |
VariableDeclaratorId |
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 |
class |
LineComment
AST node that represent line comments.
|
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 |
class |
ArrayAccessExpr |
class |
ArrayCreationExpr
new int[5][4][][] or new int[][]{{1},{2,3}} |
class |
ArrayInitializerExpr |
class |
AssignExpr |
class |
BinaryExpr |
class |
BooleanLiteralExpr |
class |
CastExpr |
class |
CharLiteralExpr |
class |
ClassExpr
Defines an expression that accesses the class of a type.
|
class |
ConditionalExpr |
class |
DoubleLiteralExpr |
class |
EnclosedExpr |
class |
Expression |
class |
FieldAccessExpr |
class |
InstanceOfExpr |
class |
IntegerLiteralExpr |
class |
LambdaExpr
Lambda expression.
|
class |
LiteralExpr |
class |
LongLiteralExpr |
class |
MarkerAnnotationExpr |
class |
MemberValuePair |
class |
MethodCallExpr |
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 |
class |
NormalAnnotationExpr |
class |
NullLiteralExpr |
class |
ObjectCreationExpr
Defines constructor call expression.
|
class |
SimpleName
A name that consists of a single identifier.
|
class |
SingleMemberAnnotationExpr |
class |
StringLiteralExpr
Java® Language Specification 3.10.5 String Literals
|
class |
SuperExpr |
class |
ThisExpr |
class |
TypeExpr
This class is just instantiated as scopes for MethodReferenceExpr nodes to encapsulate Types.
|
class |
UnaryExpr |
class |
VariableDeclarationExpr |
Modifier and Type | Class and Description |
---|---|
class |
EmptyImportDeclaration
Deprecated.
will be removed in 3.0
|
class |
ImportDeclaration
This class is a base class for classes representing import declarations.
|
class |
NonEmptyImportDeclaration
Common ancestor for all imports, aside EmptyImportDeclaration
|
class |
SingleStaticImportDeclaration
Example:
import static com.github.javaparser.JavaParser.parse;
In the example, "com.github.javaparser.JavaParser" is the type,
and "parse" is the staticMember. |
class |
SingleTypeImportDeclaration
Example:
import com.github.javaparser.JavaParser; |
class |
StaticImportOnDemandDeclaration
Example:
import static com.github.javaparser.JavaParser.*; |
class |
TypeImportOnDemandDeclaration
Examples:
import com.github.javaparser.*;
import com.github.javaparser.JavaParser.*;
Since a parser cannot differentiate between a type name and a package name, we can only store a Name. |
Modifier and Type | Interface and Description |
---|---|
interface |
NodeWithAnnotations<N extends Node>
An element which can be the target of annotations.
|
interface |
NodeWithArguments<N extends Node> |
interface |
NodeWithBlockStmt<N extends Node> |
interface |
NodeWithBody<N extends Node> |
interface |
NodeWithElementType<N extends Node>
A node having an element type.
|
interface |
NodeWithExpression<N extends Node> |
interface |
NodeWithExtends<N extends Node> |
interface |
NodeWithIdentifier<N extends Node> |
interface |
NodeWithImplements<N extends Node> |
interface |
NodeWithJavaDoc<N extends Node>
Node which can be documented through 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 having a name.
|
interface |
NodeWithOptionalBlockStmt<N extends Node> |
interface |
NodeWithParameters<N extends Node> |
interface |
NodeWithSimpleName<N extends Node>
A node having a name.
|
interface |
NodeWithStatements<N extends Node> |
interface |
NodeWithThrownExceptions<N extends Node> |
interface |
NodeWithType<N extends Node,T extends Type<?>>
A node having 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 |
NodeWithVariableDeclaratorId<N extends Node> |
interface |
NodeWithVariables<N extends Node>
A node which has a list of variables.
|
Modifier and Type | Method and Description |
---|---|
void |
PropagatingAstObserver.concreteListChange(NodeList observedNode,
AstObserver.ListChangeType type,
int index,
Node nodeAddedOrRemoved) |
void |
PropagatingAstObserver.concretePropertyChange(Node observedNode,
ObservableProperty property,
Object oldValue,
Object newValue) |
void |
PropagatingAstObserver.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 |
AstObserverAdapter.listChange(NodeList observedNode,
AstObserver.ListChangeType type,
int index,
Node nodeAddedOrRemoved) |
void |
PropagatingAstObserver.parentChange(Node observedNode,
Node previousParent,
Node newParent) |
void |
AstObserver.parentChange(Node observedNode,
Node previousParent,
Node newParent)
The parent of a node is changed
|
void |
AstObserverAdapter.parentChange(Node observedNode,
Node previousParent,
Node newParent) |
void |
PropagatingAstObserver.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
|
void |
AstObserverAdapter.propertyChange(Node observedNode,
ObservableProperty property,
Object oldValue,
Object newValue) |
Modifier and Type | Class and Description |
---|---|
class |
AssertStmt |
class |
BlockStmt |
class |
BreakStmt |
class |
CatchClause |
class |
ContinueStmt |
class |
DoStmt |
class |
EmptyStmt |
class |
ExplicitConstructorInvocationStmt |
class |
ExpressionStmt |
class |
ForeachStmt |
class |
ForStmt |
class |
IfStmt |
class |
LabeledStmt |
class |
ReturnStmt |
class |
Statement |
class |
SwitchEntryStmt |
class |
SwitchStmt |
class |
SynchronizedStmt |
class |
ThrowStmt |
class |
TryStmt |
class |
TypeDeclarationStmt |
class |
WhileStmt |
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 |
class |
IntersectionType
Represents a set of types.
|
class |
PrimitiveType |
class |
ReferenceType<T extends ReferenceType> |
class |
Type<T extends Type> |
class |
TypeParameter
This class represents the declaration of a generics argument.
|
class |
UnionType
Represents a set of types.
|
class |
UnknownType
An unknown parameter type object.
|
class |
VoidType |
class |
WildcardType |
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 |
---|---|
static boolean |
EqualsVisitor.equals(Node n1,
Node n2) |
abstract void |
TreeVisitor.process(Node node) |
void |
TreeVisitor.visitBreadthFirst(Node node)
https://en.wikipedia.org/wiki/Breadth-first_search
|
void |
TreeVisitor.visitDepthFirst(Node node)
https://en.wikipedia.org/wiki/Depth-first_search
|
Modifier and Type | Method and Description |
---|---|
String |
PrettyPrinter.print(Node node) |
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) |
static <T extends Node> |
PositionUtils.sortByBeginPosition(NodeList<T> nodes,
boolean ignoringAnnotations) |
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 |
PositionUtils.nodeContains(Node container,
Node contained,
boolean ignoringAnnotations) |
Copyright © 2007–2016. All rights reserved.