public final class TransformationUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
addASTAnnotationsFromTo(ClassNode annotated,
CompilePhase compilePhase)
All transformation will be always annotated with:
InheritConstructors
GroovyASTTransformation
To avoid repeating this over and over again this method adds
both to the annotated ClassNode passed as first
argument |
static PropertyExpression |
getCompilePhaseAsPropertyExpression(CompilePhase compilePhase)
Creates a
PropertyExpression containing a CompilePhase. |
static AnnotationNode |
getGroovyAnnotation(CompilePhase compilePhase)
Creates an
AnnotationNode of type GroovyASTTransformation. |
static AnnotationNode |
getInheritConstructorsAnnotation()
Builds a
AnnotationNode of type InheritConstructors |
public static void addASTAnnotationsFromTo(ClassNode annotated, CompilePhase compilePhase)
ClassNode passed as first
argumentannotated - The ClassNode we want to add both
annotations tocompilePhase - The CompilePhase used as argument for
the GroovyASTTransformation annotation.public static AnnotationNode getGroovyAnnotation(CompilePhase compilePhase)
AnnotationNode of type GroovyASTTransformation.compilePhase - the target CompilePhase used as value of the
GroovyASTTransformation annotationGroovyASTTransformation annotationpublic static PropertyExpression getCompilePhaseAsPropertyExpression(CompilePhase compilePhase)
PropertyExpression containing a CompilePhase. This property
can be used, for instance, as default value for a given annotation.compilePhase - an instance of CompilePhasePropertyExpressionpublic static AnnotationNode getInheritConstructorsAnnotation()
AnnotationNode of type InheritConstructorsAnnotationNode representing a InheritConstructors