Package org.codehaus.groovy.ast
Class ClassCodeExpressionTransformer
- java.lang.Object
-
- org.codehaus.groovy.ast.CodeVisitorSupport
-
- org.codehaus.groovy.ast.ClassCodeVisitorSupport
-
- org.codehaus.groovy.ast.ClassCodeExpressionTransformer
-
- All Implemented Interfaces:
ExpressionTransformer
,GroovyClassVisitor
,GroovyCodeVisitor
,ErrorCollecting
- Direct Known Subclasses:
FieldASTTransformation
,NewifyASTTransformation
,OptimizerVisitor
,ResolveVisitor
,StaticCompilationTransformer
,StaticImportVisitor
public abstract class ClassCodeExpressionTransformer extends ClassCodeVisitorSupport implements ExpressionTransformer
Visitor to transform expressions in a whole class. Transformed Expressions are usually not visited.
-
-
Constructor Summary
Constructors Constructor Description ClassCodeExpressionTransformer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Expression
transform(Expression exp)
Transforms the given expression into another expressionvoid
visitAnnotations(AnnotatedNode node)
void
visitAssertStatement(AssertStatement as)
void
visitCaseStatement(CaseStatement statement)
protected void
visitConstructorOrMethod(MethodNode node, boolean isConstructor)
void
visitDoWhileLoop(DoWhileStatement loop)
void
visitExpressionStatement(ExpressionStatement es)
void
visitField(FieldNode node)
Visit a FieldNode.void
visitForLoop(ForStatement forLoop)
void
visitIfElse(IfStatement ifElse)
void
visitProperty(PropertyNode node)
Visit a PropertyNode.void
visitReturnStatement(ReturnStatement statement)
void
visitSwitch(SwitchStatement statement)
void
visitSynchronizedStatement(SynchronizedStatement sync)
void
visitThrowStatement(ThrowStatement ts)
void
visitWhileLoop(WhileStatement loop)
-
Methods inherited from class org.codehaus.groovy.ast.ClassCodeVisitorSupport
addError, getSourceUnit, visitBlockStatement, visitBreakStatement, visitCatchStatement, visitClass, visitClassCodeContainer, visitConstructor, visitContinueStatement, visitDeclarationExpression, visitImports, visitMethod, visitObjectInitializerStatements, visitPackage, visitStatement, visitTryCatchFinally
-
Methods inherited from class org.codehaus.groovy.ast.CodeVisitorSupport
visitArgumentlistExpression, visitArrayExpression, visitAttributeExpression, visitBinaryExpression, visitBitwiseNegationExpression, visitBooleanExpression, visitBytecodeExpression, visitCastExpression, visitClassExpression, visitClosureExpression, visitClosureListExpression, visitConstantExpression, visitConstructorCallExpression, visitEmptyStatement, visitFieldExpression, visitGStringExpression, visitListExpression, visitListOfExpressions, visitMapEntryExpression, visitMapExpression, visitMethodCallExpression, visitMethodPointerExpression, visitNotExpression, visitPostfixExpression, visitPrefixExpression, visitPropertyExpression, visitRangeExpression, visitShortTernaryExpression, visitSpreadExpression, visitSpreadMapExpression, visitStaticMethodCallExpression, visitTernaryExpression, visitTupleExpression, visitUnaryMinusExpression, visitUnaryPlusExpression, visitVariableExpression
-
-
-
-
Method Detail
-
visitConstructorOrMethod
protected void visitConstructorOrMethod(MethodNode node, boolean isConstructor)
- Overrides:
visitConstructorOrMethod
in classClassCodeVisitorSupport
-
visitSwitch
public void visitSwitch(SwitchStatement statement)
- Specified by:
visitSwitch
in interfaceGroovyCodeVisitor
- Overrides:
visitSwitch
in classClassCodeVisitorSupport
-
visitField
public void visitField(FieldNode node)
Description copied from interface:GroovyClassVisitor
Visit a FieldNode.- Specified by:
visitField
in interfaceGroovyClassVisitor
- Overrides:
visitField
in classClassCodeVisitorSupport
-
visitProperty
public void visitProperty(PropertyNode node)
Description copied from interface:GroovyClassVisitor
Visit a PropertyNode.- Specified by:
visitProperty
in interfaceGroovyClassVisitor
- Overrides:
visitProperty
in classClassCodeVisitorSupport
-
visitIfElse
public void visitIfElse(IfStatement ifElse)
- Specified by:
visitIfElse
in interfaceGroovyCodeVisitor
- Overrides:
visitIfElse
in classClassCodeVisitorSupport
-
transform
public Expression transform(Expression exp)
Description copied from interface:ExpressionTransformer
Transforms the given expression into another expression- Specified by:
transform
in interfaceExpressionTransformer
-
visitAnnotations
public void visitAnnotations(AnnotatedNode node)
- Overrides:
visitAnnotations
in classClassCodeVisitorSupport
-
visitReturnStatement
public void visitReturnStatement(ReturnStatement statement)
- Specified by:
visitReturnStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitReturnStatement
in classClassCodeVisitorSupport
-
visitAssertStatement
public void visitAssertStatement(AssertStatement as)
- Specified by:
visitAssertStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitAssertStatement
in classClassCodeVisitorSupport
-
visitCaseStatement
public void visitCaseStatement(CaseStatement statement)
- Specified by:
visitCaseStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitCaseStatement
in classClassCodeVisitorSupport
-
visitDoWhileLoop
public void visitDoWhileLoop(DoWhileStatement loop)
- Specified by:
visitDoWhileLoop
in interfaceGroovyCodeVisitor
- Overrides:
visitDoWhileLoop
in classClassCodeVisitorSupport
-
visitForLoop
public void visitForLoop(ForStatement forLoop)
- Specified by:
visitForLoop
in interfaceGroovyCodeVisitor
- Overrides:
visitForLoop
in classClassCodeVisitorSupport
-
visitSynchronizedStatement
public void visitSynchronizedStatement(SynchronizedStatement sync)
- Specified by:
visitSynchronizedStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitSynchronizedStatement
in classClassCodeVisitorSupport
-
visitThrowStatement
public void visitThrowStatement(ThrowStatement ts)
- Specified by:
visitThrowStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitThrowStatement
in classClassCodeVisitorSupport
-
visitWhileLoop
public void visitWhileLoop(WhileStatement loop)
- Specified by:
visitWhileLoop
in interfaceGroovyCodeVisitor
- Overrides:
visitWhileLoop
in classClassCodeVisitorSupport
-
visitExpressionStatement
public void visitExpressionStatement(ExpressionStatement es)
- Specified by:
visitExpressionStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitExpressionStatement
in classClassCodeVisitorSupport
-
-