public class InvalidationListenerASTTransformation extends AbstractASTTransformation
@InvalidationListener
annotation.
Any closures found as the annotation's value will be either transformed into inner classes that implement InvalidationListener (when the value is a closure defined in place) or be casted as a proxy of InvalidationListener (when the value is a property reference found in the same class).
List of closures are also supported.
COLLECTIONS_CLASS, GRIFFON_APPLICATION_TYPE, INJECT_TYPE, NAMED_TYPE
Constructor and Description |
---|
InvalidationListenerASTTransformation() |
Modifier and Type | Method and Description |
---|---|
static void |
addListenerToProperty(org.codehaus.groovy.control.SourceUnit source,
org.codehaus.groovy.ast.AnnotationNode annotation,
org.codehaus.groovy.ast.ClassNode declaringClass,
org.codehaus.groovy.ast.FieldNode field) |
static boolean |
hasListenerAnnotation(org.codehaus.groovy.ast.AnnotatedNode node)
Convenience method to see if an annotated node is
@InvalidationListener . |
void |
visit(org.codehaus.groovy.ast.ASTNode[] nodes,
org.codehaus.groovy.control.SourceUnit source)
Handles the bulk of the processing, mostly delegating to other methods.
|
addDelegateMethods, addError, applicationExpression, applicationProperty, checkNodesForAnnotationAndType, emptyMap, injectApplication, injectedField, injectedField, makeClassSafe, makeClassSafe, makeClassSafe, makeClassSafe0, makeClassSafeWithGenerics, makeClassSafeWithGenerics, makeClassSafeWithGenerics, makeGenericsType, makeGenericsType, makeGenericsType, memberHasValue, needsDelegate, newClass
public InvalidationListenerASTTransformation()
public static boolean hasListenerAnnotation(org.codehaus.groovy.ast.AnnotatedNode node)
@InvalidationListener
.node
- the node to checkpublic static void addListenerToProperty(org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.ast.AnnotationNode annotation, org.codehaus.groovy.ast.ClassNode declaringClass, org.codehaus.groovy.ast.FieldNode field)
public void visit(org.codehaus.groovy.ast.ASTNode[] nodes, org.codehaus.groovy.control.SourceUnit source)
nodes
- the ast nodessource
- the source unit for the nodes