Package | Description |
---|---|
com.github.javaparser | |
com.github.javaparser.ast.expr | |
com.github.javaparser.ast.nodeTypes | |
com.github.javaparser.ast.stmt |
Modifier and Type | Field and Description |
---|---|
static ParseStart<Statement> |
ParseStart.STATEMENT |
Modifier and Type | Method and Description |
---|---|
static Statement |
StaticJavaParser.parseStatement(String statement)
|
Statement |
JavaParserAdapter.parseStatement(String statement) |
Modifier and Type | Method and Description |
---|---|
ParseResult<Statement> |
JavaParser.parseStatement(String statement)
|
Modifier and Type | Method and Description |
---|---|
Statement |
LambdaExpr.getBody() |
Modifier and Type | Method and Description |
---|---|
LambdaExpr |
LambdaExpr.setBody(Statement body) |
Constructor and Description |
---|
LambdaExpr(NodeList<Parameter> parameters,
Statement body,
boolean isEnclosingParameters) |
LambdaExpr(TokenRange tokenRange,
NodeList<Parameter> parameters,
Statement body,
boolean isEnclosingParameters)
This constructor is used by the parser and is considered private.
|
Modifier and Type | Method and Description |
---|---|
default <A extends Statement> |
NodeWithStatements.addAndGetStatement(A statement) |
Modifier and Type | Method and Description |
---|---|
default Statement |
NodeWithStatements.addAndGetStatement(int index,
Statement statement) |
Statement |
NodeWithBody.getBody() |
default Statement |
NodeWithStatements.getStatement(int i) |
Modifier and Type | Method and Description |
---|---|
NodeList<Statement> |
NodeWithStatements.getStatements() |
Modifier and Type | Method and Description |
---|---|
default Statement |
NodeWithStatements.addAndGetStatement(int index,
Statement statement) |
default N |
NodeWithStatements.addStatement(int index,
Statement statement) |
default N |
NodeWithStatements.addStatement(Statement statement) |
N |
NodeWithBody.setBody(Statement body) |
default N |
NodeWithStatements.setStatement(int i,
Statement statement) |
Modifier and Type | Method and Description |
---|---|
default N |
NodeWithStatements.copyStatements(NodeList<Statement> nodeList) |
N |
NodeWithStatements.setStatements(NodeList<Statement> statements) |
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 |
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 |
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 |
---|---|
Statement |
Statement.clone() |
Statement |
WhileStmt.getBody() |
Statement |
ForStmt.getBody() |
Statement |
ForEachStmt.getBody() |
Statement |
DoStmt.getBody() |
Statement |
LabeledStmt.getStatement() |
Statement |
IfStmt.getThenStmt() |
Modifier and Type | Method and Description |
---|---|
Optional<Statement> |
IfStmt.getElseStmt() |
NodeList<Statement> |
SwitchEntry.getStatements() |
NodeList<Statement> |
BlockStmt.getStatements() |
Modifier and Type | Method and Description |
---|---|
WhileStmt |
WhileStmt.setBody(Statement body) |
ForStmt |
ForStmt.setBody(Statement body) |
ForEachStmt |
ForEachStmt.setBody(Statement body) |
DoStmt |
DoStmt.setBody(Statement body) |
IfStmt |
IfStmt.setElseStmt(Statement elseStmt)
Sets the elseStmt
|
LabeledStmt |
LabeledStmt.setStatement(Statement statement) |
IfStmt |
IfStmt.setThenStmt(Statement thenStmt) |
Modifier and Type | Method and Description |
---|---|
SwitchEntry |
SwitchEntry.setStatements(NodeList<Statement> statements) |
BlockStmt |
BlockStmt.setStatements(NodeList<Statement> statements) |
Constructor and Description |
---|
DoStmt(Statement body,
Expression condition) |
DoStmt(TokenRange tokenRange,
Statement body,
Expression condition)
This constructor is used by the parser and is considered private.
|
ForEachStmt(TokenRange tokenRange,
VariableDeclarationExpr variable,
Expression iterable,
Statement body)
This constructor is used by the parser and is considered private.
|
ForEachStmt(VariableDeclarationExpr variable,
Expression iterable,
Statement body) |
ForStmt(NodeList<Expression> initialization,
Expression compare,
NodeList<Expression> update,
Statement body) |
ForStmt(TokenRange tokenRange,
NodeList<Expression> initialization,
Expression compare,
NodeList<Expression> update,
Statement body)
This constructor is used by the parser and is considered private.
|
IfStmt(Expression condition,
Statement thenStmt,
Statement elseStmt) |
IfStmt(TokenRange tokenRange,
Expression condition,
Statement thenStmt,
Statement elseStmt)
This constructor is used by the parser and is considered private.
|
LabeledStmt(SimpleName label,
Statement statement) |
LabeledStmt(String label,
Statement statement) |
LabeledStmt(TokenRange tokenRange,
SimpleName label,
Statement statement)
This constructor is used by the parser and is considered private.
|
WhileStmt(Expression condition,
Statement body) |
WhileStmt(TokenRange tokenRange,
Expression condition,
Statement body)
This constructor is used by the parser and is considered private.
|
Constructor and Description |
---|
BlockStmt(NodeList<Statement> statements) |
BlockStmt(TokenRange tokenRange,
NodeList<Statement> statements)
This constructor is used by the parser and is considered private.
|
SwitchEntry(NodeList<Expression> labels,
SwitchEntry.Type type,
NodeList<Statement> statements)
This constructor exists for backwards compatibility for code that instantiated `SwitchEntries` before
the `isDefault` and guard fields were added.
|
SwitchEntry(NodeList<Expression> labels,
SwitchEntry.Type type,
NodeList<Statement> statements,
boolean isDefault) |
SwitchEntry(TokenRange tokenRange,
NodeList<Expression> labels,
SwitchEntry.Type type,
NodeList<Statement> statements)
This constructor exists for backwards compatibility for code that instantiated `SwitchEntries` before
the `isDefault` and guard fields were added.
|
SwitchEntry(TokenRange tokenRange,
NodeList<Expression> labels,
SwitchEntry.Type type,
NodeList<Statement> statements,
boolean isDefault)
This constructor is used by the parser and is considered private.
|
SwitchEntry(TokenRange tokenRange,
NodeList<Expression> labels,
SwitchEntry.Type type,
NodeList<Statement> statements,
boolean isDefault,
Expression guard)
This constructor is used by the parser and is considered private.
|
Copyright © 2007–2024. All rights reserved.