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
Constructors Constructor Description ClassCodeExpressionTransformer()
-
Method Summary
-
Methods inherited from class org.codehaus.groovy.ast.ClassCodeVisitorSupport
addError, getSourceUnit, 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
visitEmptyExpression, visitListOfExpressions
-
-
-
-
Method Detail
-
transform
public Expression transform(Expression expr)
Description copied from interface:ExpressionTransformer
Transforms the given expression into another expression- Specified by:
transform
in interfaceExpressionTransformer
-
visitAnnotation
protected void visitAnnotation(AnnotationNode node)
- Overrides:
visitAnnotation
in classClassCodeVisitorSupport
-
visitConstructorOrMethod
protected void visitConstructorOrMethod(MethodNode node, boolean isConstructor)
- Overrides:
visitConstructorOrMethod
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
-
visitAssertStatement
public void visitAssertStatement(AssertStatement stmt)
- Specified by:
visitAssertStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitAssertStatement
in classClassCodeVisitorSupport
-
visitCaseStatement
public void visitCaseStatement(CaseStatement stmt)
- Specified by:
visitCaseStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitCaseStatement
in classClassCodeVisitorSupport
-
visitDoWhileLoop
public void visitDoWhileLoop(DoWhileStatement stmt)
- Specified by:
visitDoWhileLoop
in interfaceGroovyCodeVisitor
- Overrides:
visitDoWhileLoop
in classClassCodeVisitorSupport
-
visitExpressionStatement
public void visitExpressionStatement(ExpressionStatement stmt)
- Specified by:
visitExpressionStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitExpressionStatement
in classClassCodeVisitorSupport
-
visitForLoop
public void visitForLoop(ForStatement stmt)
- Specified by:
visitForLoop
in interfaceGroovyCodeVisitor
- Overrides:
visitForLoop
in classClassCodeVisitorSupport
-
visitIfElse
public void visitIfElse(IfStatement stmt)
- Specified by:
visitIfElse
in interfaceGroovyCodeVisitor
- Overrides:
visitIfElse
in classClassCodeVisitorSupport
-
visitReturnStatement
public void visitReturnStatement(ReturnStatement stmt)
- Specified by:
visitReturnStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitReturnStatement
in classClassCodeVisitorSupport
-
visitSwitch
public void visitSwitch(SwitchStatement stmt)
- Specified by:
visitSwitch
in interfaceGroovyCodeVisitor
- Overrides:
visitSwitch
in classClassCodeVisitorSupport
-
visitSynchronizedStatement
public void visitSynchronizedStatement(SynchronizedStatement stmt)
- Specified by:
visitSynchronizedStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitSynchronizedStatement
in classClassCodeVisitorSupport
-
visitThrowStatement
public void visitThrowStatement(ThrowStatement stmt)
- Specified by:
visitThrowStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitThrowStatement
in classClassCodeVisitorSupport
-
visitWhileLoop
public void visitWhileLoop(WhileStatement stmt)
- Specified by:
visitWhileLoop
in interfaceGroovyCodeVisitor
- Overrides:
visitWhileLoop
in classClassCodeVisitorSupport
-
setSourcePosition
protected static void setSourcePosition(Expression toSet, Expression origNode)
Set the source position of toSet including its property expression if it has one.- Parameters:
toSet
- resulting nodeorigNode
- original node
-
-