@AnnotationHandlerFor(value=EventPublisher.class) public class EventPublisherASTTransformation extends AbstractASTTransformation implements EventPublisherConstants, AnnotationHandler
@EventPublisher
annotation.
Generally, it adds (if needed) an EventRouter field and
the needed add/removeEventListener methods to support the
listeners.
COLLECTIONS_CLASS, GRIFFON_APPLICATION_TYPE, INJECT_TYPE, NAMED_TYPE
E, EVENT_PUBLISHER_FIELD_NAME, EVENT_PUBLISHER_TYPE, EVENT_ROUTER_PROPERTY, EVENT_ROUTER_TYPE, EVENT_TYPE, METHOD_ADD_EVENT_LISTENER, METHOD_GET_EVENT_LISTENERS, METHOD_IS_EVENT_PUBLISHING_ENABLED, METHOD_PUBLISH_EVENT, METHOD_PUBLISH_EVENT_ASYNC, METHOD_PUBLISH_EVENT_OUTSIDE_UI, METHOD_REMOVE_EVENT_LISTENER, METHOD_SET_EVENT_PUBLISHING_ENABLED, METHOD_SET_EVENT_ROUTER, METHODS
APPLICATION, BOOLEAN, GRIFFON_CORE_CALLABLEWITHARGS, GRIFFON_CORE_RUNNABLEWITHARGS, INT, JAVA_LANG_CLASS, JAVA_LANG_OBJECT, JAVA_LANG_RUNNABLE, JAVA_LANG_STRING, JAVA_NET_URL, JAVA_UTIL_COLLECTION, JAVA_UTIL_LIST, JAVA_UTIL_MAP, JAVAX_ANNOTATION_NONNULL, JAVAX_ANNOTATION_NULLABLE, JAVAX_INJECT_INJECT, JAVAX_INJECT_NAMED, NAME, R, T, VOID, WILDCARD
Constructor and Description |
---|
EventPublisherASTTransformation() |
Modifier and Type | Method and Description |
---|---|
static void |
addEventPublisherIfNeeded(org.codehaus.groovy.control.SourceUnit source,
org.codehaus.groovy.ast.AnnotationNode annotationNode,
org.codehaus.groovy.ast.ClassNode classNode) |
static void |
apply(org.codehaus.groovy.ast.ClassNode declaringClass,
String beanName)
Adds the necessary field and methods to support resource locating.
|
static boolean |
hasEventPublisherAnnotation(org.codehaus.groovy.ast.AnnotatedNode node)
Convenience method to see if an annotated node is
@EventPublisher . |
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 static boolean hasEventPublisherAnnotation(org.codehaus.groovy.ast.AnnotatedNode node)
@EventPublisher
.node
- the node to checkpublic void visit(org.codehaus.groovy.ast.ASTNode[] nodes, org.codehaus.groovy.control.SourceUnit source)
visit
in interface org.codehaus.groovy.transform.ASTTransformation
nodes
- the ast nodessource
- the source unit for the nodespublic static void addEventPublisherIfNeeded(org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.ast.AnnotationNode annotationNode, org.codehaus.groovy.ast.ClassNode classNode)