Class ASTTransformationVisitor
- All Implemented Interfaces:
- GroovyClassVisitor,- GroovyCodeVisitor,- ErrorCollecting
 ASTTransformationCollectorCodeVisitor will add a list
 of annotations that this visitor should be concerned about.  All other
 annotations are ignored, whether they are GroovyASTTransformation
 annotated or not.
 
A Two-pass method is used. First all candidate annotations are added to a list then the transformations are called on those collected annotations. This is done to avoid concurrent modification exceptions during the AST tree walk and allows the transformations to alter any portion of the AST tree. Hence annotations that are added in this phase will not be processed as transformations. They will only be handled in later phases (and then only if the type was in the AST prior to any AST transformations being run against it).
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidstatic voidstatic voidaddNewPhaseOperation(CompilationUnit compilationUnit, SourceUnit sourceUnit, ClassNode classNode) Enables transforms for class that was added during current phase.static voidaddPhaseOperations(CompilationUnit compilationUnit) protected SourceUnitvoidAdds the annotation to the internal target list if a match is found.voidvisitClass(ClassNode classNode) Main loop entry.voidvisitProperty(PropertyNode node) Visit a PropertyNode.Methods inherited from class org.codehaus.groovy.ast.ClassCodeVisitorSupportaddError, visitAnnotation, visitAnnotations, visitAssertStatement, visitBlockStatement, visitBreakStatement, visitCaseStatement, visitCatchStatement, visitClassCodeContainer, visitConstructor, visitConstructorOrMethod, visitContinueStatement, visitDeclarationExpression, visitDoWhileLoop, visitExpressionStatement, visitField, visitForLoop, visitIfElse, visitImports, visitMethod, visitObjectInitializerStatements, visitPackage, visitReturnStatement, visitStatement, visitSwitch, visitSynchronizedStatement, visitThrowStatement, visitTryCatchFinally, visitWhileLoopMethods inherited from class org.codehaus.groovy.ast.CodeVisitorSupportafterSwitchConditionExpressionVisited, 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, visitVariableExpressionMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.codehaus.groovy.ast.GroovyCodeVisitorvisit, visit, visitEmptyExpression, visitListOfExpressions
- 
Method Details- 
getSourceUnit- Specified by:
- getSourceUnitin class- ClassCodeVisitorSupport
 
- 
visitClassMain loop entry.First, it delegates to the super visitClass so we can collect the relevant annotations in an AST tree walk. Second, it calls the visit method on the transformation for each relevant annotation found. - Specified by:
- visitClassin interface- GroovyClassVisitor
- Overrides:
- visitClassin class- ClassCodeVisitorSupport
- Parameters:
- classNode- the class to visit
 
- 
visitAnnotationsAdds the annotation to the internal target list if a match is found.- Overrides:
- visitAnnotationsin class- ClassCodeVisitorSupport
- Parameters:
- node- the node to be processed
 
- 
visitPropertyDescription copied from interface:GroovyClassVisitorVisit a PropertyNode.- Specified by:
- visitPropertyin interface- GroovyClassVisitor
- Overrides:
- visitPropertyin class- ClassCodeVisitorSupport
 
- 
addPhaseOperations
- 
addNewPhaseOperationpublic static void addNewPhaseOperation(CompilationUnit compilationUnit, SourceUnit sourceUnit, ClassNode classNode) Enables transforms for class that was added during current phase.
- 
addGlobalTransformsAfterGrab
- 
addGlobalTransforms
 
-