public abstract class ClassCodeExpressionTransformer extends ClassCodeVisitorSupport implements ExpressionTransformer
Transforms expressions in a whole class. Transformed expressions are usually not visited.
Type Params | Return Type | Name and description |
---|---|---|
|
public Expression |
transform(Expression expr) NOTE: This method does not visit Expressions within Closures, for performance and historical reasons. |
|
public void |
visitAssertStatement(AssertStatement stmt) |
|
public void |
visitCaseStatement(CaseStatement stmt) |
|
public void |
visitDoWhileLoop(DoWhileStatement stmt) |
|
public void |
visitExpressionStatement(ExpressionStatement stmt) |
|
public void |
visitField(FieldNode node) |
|
public void |
visitForLoop(ForStatement stmt) |
|
public void |
visitIfElse(IfStatement stmt) |
|
public void |
visitProperty(PropertyNode node) |
|
public void |
visitReturnStatement(ReturnStatement stmt) |
|
public void |
visitSwitch(SwitchStatement stmt) |
|
public void |
visitSynchronizedStatement(SynchronizedStatement stmt) |
|
public void |
visitThrowStatement(ThrowStatement stmt) |
|
public void |
visitWhileLoop(WhileStatement stmt) |
NOTE: This method does not visit Expressions within Closures, for performance and historical reasons. If you want those Expressions to be visited, you can do this:
public class YourTransformer extends ClassCodeExpressionTransformer {
...
@Override
public Expression transform(final Expression expr) {
if (expr instanceof ClosureExpression) {
expr.visit(this);
return expr;
// ...
}
}}