Package io.codemodder.javaparser
Class ASTExpectations.NodeExpectation
java.lang.Object
io.codemodder.javaparser.ASTExpectations.NodeExpectation
- Enclosing class:
- ASTExpectations
A type for querying and filtering generic AST nodes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOptional<com.github.javaparser.ast.Node>
result()
Return an expectation that asserts the node is aExpressionStmt
.Return an expectation that asserts the node is aFieldAccessExpr
.Return an expectation that asserts the node is aMethodCallExpr
.Return an expectation that asserts the node is aNameExpr
.Return an expectation that asserts the node is anExpressionStmt
with aVariableDeclarationExpr
for its expression.Return an expectation that asserts the parent node is aBlockStmt
.
-
Constructor Details
-
NodeExpectation
public NodeExpectation(com.github.javaparser.ast.Node node)
-
-
Method Details
-
withBlockParent
Return an expectation that asserts the parent node is aBlockStmt
. -
toBeVariableDeclarationStatement
Return an expectation that asserts the node is anExpressionStmt
with aVariableDeclarationExpr
for its expression. -
toBeMethodCallExpression
Return an expectation that asserts the node is aMethodCallExpr
. -
toBeExpressionStatement
Return an expectation that asserts the node is aExpressionStmt
. -
toBeNameExpression
Return an expectation that asserts the node is aNameExpr
. -
toBeFieldAccessExpression
Return an expectation that asserts the node is aFieldAccessExpr
. -
toBeStringLiteral
-
result
-