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
Transforms expressions in a whole class. Transformed expressions are usually not visited.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static void
setSourcePosition
(Expression toSet, Expression origNode) Set the source position of toSet including its property expression if it has one.transform
(Expression expr) Transforms the given expression into another expressionprotected void
void
void
protected void
visitConstructorOrMethod
(MethodNode node, boolean isConstructor) void
void
void
visitField
(FieldNode node) Visit a FieldNode.void
visitForLoop
(ForStatement stmt) void
visitIfElse
(IfStatement stmt) void
visitProperty
(PropertyNode node) Visit a PropertyNode.void
void
visitSwitch
(SwitchStatement stmt) void
void
void
visitWhileLoop
(WhileStatement stmt) Methods inherited from class org.codehaus.groovy.ast.ClassCodeVisitorSupport
addError, getSourceUnit, visitAnnotations, visitAnnotations, visitBlockStatement, visitBreakStatement, visitCatchStatement, visitClass, visitClassCodeContainer, visitConstructor, visitContinueStatement, visitDeclarationExpression, visitImports, visitMethod, visitObjectInitializerStatements, visitPackage, visitStatement, visitTryCatchFinally
Methods inherited from class org.codehaus.groovy.ast.CodeVisitorSupport
afterSwitchConditionExpressionVisited, visitArgumentlistExpression, visitArrayExpression, visitAttributeExpression, visitBinaryExpression, visitBitwiseNegationExpression, visitBooleanExpression, visitBytecodeExpression, visitCastExpression, visitClassExpression, visitClosureExpression, visitClosureListExpression, visitConstantExpression, visitConstructorCallExpression, visitEmptyStatement, visitFieldExpression, visitGStringExpression, visitLambdaExpression, visitListExpression, visitMapEntryExpression, visitMapExpression, visitMethodCallExpression, visitMethodPointerExpression, visitMethodReferenceExpression, visitNotExpression, visitPostfixExpression, visitPrefixExpression, visitPropertyExpression, visitRangeExpression, visitShortTernaryExpression, visitSpreadExpression, visitSpreadMapExpression, visitStaticMethodCallExpression, visitTernaryExpression, visitTupleExpression, visitUnaryMinusExpression, visitUnaryPlusExpression, visitVariableExpression
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.codehaus.groovy.ast.GroovyCodeVisitor
visit, visit, visitEmptyExpression, visitListOfExpressions
-
Constructor Details
-
ClassCodeExpressionTransformer
public ClassCodeExpressionTransformer()
-
-
Method Details
-
transform
Description copied from interface:ExpressionTransformer
Transforms the given expression into another expression- Specified by:
transform
in interfaceExpressionTransformer
-
visitAnnotation
- Overrides:
visitAnnotation
in classClassCodeVisitorSupport
-
visitConstructorOrMethod
- Overrides:
visitConstructorOrMethod
in classClassCodeVisitorSupport
-
visitField
Description copied from interface:GroovyClassVisitor
Visit a FieldNode.- Specified by:
visitField
in interfaceGroovyClassVisitor
- Overrides:
visitField
in classClassCodeVisitorSupport
-
visitProperty
Description copied from interface:GroovyClassVisitor
Visit a PropertyNode.- Specified by:
visitProperty
in interfaceGroovyClassVisitor
- Overrides:
visitProperty
in classClassCodeVisitorSupport
-
visitAssertStatement
- Specified by:
visitAssertStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitAssertStatement
in classClassCodeVisitorSupport
-
visitCaseStatement
- Specified by:
visitCaseStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitCaseStatement
in classClassCodeVisitorSupport
-
visitDoWhileLoop
- Specified by:
visitDoWhileLoop
in interfaceGroovyCodeVisitor
- Overrides:
visitDoWhileLoop
in classClassCodeVisitorSupport
-
visitExpressionStatement
- Specified by:
visitExpressionStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitExpressionStatement
in classClassCodeVisitorSupport
-
visitForLoop
- Specified by:
visitForLoop
in interfaceGroovyCodeVisitor
- Overrides:
visitForLoop
in classClassCodeVisitorSupport
-
visitIfElse
- Specified by:
visitIfElse
in interfaceGroovyCodeVisitor
- Overrides:
visitIfElse
in classClassCodeVisitorSupport
-
visitReturnStatement
- Specified by:
visitReturnStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitReturnStatement
in classClassCodeVisitorSupport
-
visitSwitch
- Specified by:
visitSwitch
in interfaceGroovyCodeVisitor
- Overrides:
visitSwitch
in classClassCodeVisitorSupport
-
visitSynchronizedStatement
- Specified by:
visitSynchronizedStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitSynchronizedStatement
in classClassCodeVisitorSupport
-
visitThrowStatement
- Specified by:
visitThrowStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitThrowStatement
in classClassCodeVisitorSupport
-
visitWhileLoop
- Specified by:
visitWhileLoop
in interfaceGroovyCodeVisitor
- Overrides:
visitWhileLoop
in classClassCodeVisitorSupport
-
setSourcePosition
Set the source position of toSet including its property expression if it has one.- Parameters:
toSet
- resulting nodeorigNode
- original node
-