|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.groovy.ast.CodeVisitorSupport
org.codehaus.groovy.ast.ClassCodeVisitorSupport
org.codehaus.groovy.transform.ASTTransformationVisitor
public class ASTTransformationVisitor
This class handles the invocation of the ASTAnnotationTransformation when it is encountered by a tree walk. One instance of each exists for each phase of the compilation it applies to. Before invocation the
ASTTransformationCollectorCodeVisitor
will add a list
of annotations that this visitor should be concerned about. All other
annotations are ignored, whether or not 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 Summary | |
---|---|
static void |
addGlobalTransforms(CompilationUnit compilationUnit)
|
static void |
addGlobalTransformsAfterGrab()
|
static void |
addPhaseOperations(CompilationUnit compilationUnit)
|
protected SourceUnit |
getSourceUnit()
|
void |
visitAnnotations(AnnotatedNode node)
Adds the annotation to the internal target list if a match is found. |
void |
visitClass(ClassNode classNode)
Main loop entry. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
protected SourceUnit getSourceUnit()
getSourceUnit
in class ClassCodeVisitorSupport
public void visitClass(ClassNode classNode)
visitClass
in interface GroovyClassVisitor
visitClass
in class ClassCodeVisitorSupport
classNode
- the class to visitpublic void visitAnnotations(AnnotatedNode node)
visitAnnotations
in class ClassCodeVisitorSupport
node
- the node to be processedpublic static void addPhaseOperations(CompilationUnit compilationUnit)
public static void addGlobalTransformsAfterGrab()
public static void addGlobalTransforms(CompilationUnit compilationUnit)
|
Copyright © 2003-2009 The Codehaus. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |