|
|||||
| FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||
| Field Summary | |
|---|---|
ClassNode |
boundClassNode
|
ClassNode |
pcsClassNode
|
FieldNode |
pcsField
|
| Constructor Summary | |
BindableASTTransformation()
|
|
| Method Summary | |
|---|---|
void |
addListenerToClass(SourceUnit source, AnnotationNode node, ClassNode classNode)
|
void |
addListenerToProperty(SourceUnit source, AnnotationNode node, ClassNode declaringClass, FieldNode field)
|
void |
addPropertyChangeSupport(ClassNode declaringClass)
Adds the necessary field and methods to support property change support. |
Statement |
createBindableStatement(PropertyNode propertyNode, Expression fieldExpression)
Creates a statement body similar to: pcsField.firePropertyChange("field", field, field = value)
|
void |
createListenerSetter(SourceUnit source, AnnotationNode node, ClassNode classNode, PropertyNode propertyNode)
|
void |
createSetterMethod(ClassNode declaringClass, PropertyNode propertyNode, String setterName, Statement setterBlock)
Creates a setter method with the given body. |
static boolean |
hasBindableAnnotation(AnnotatedNode node)
The found or created PropertyChangeSupport field |
boolean |
needsPropertyChangeSupport(ClassNode declaringClass)
Snoops through the declaring class and all parents looking for a field of type PropertyChangeSupport. |
void |
visit(def nodes, SourceUnit source)
Handles the bulk of the processing, mostly delegating to other methods. |
| Constructor Detail |
|---|
BindableASTTransformation()
| Method Detail |
|---|
void addListenerToClass(SourceUnit source, AnnotationNode node, ClassNode classNode)
void addListenerToProperty(SourceUnit source, AnnotationNode node, ClassNode declaringClass, FieldNode field)
void addPropertyChangeSupport(ClassNode declaringClass)
protected final java.beans.PropertyChangeSupport this$PropertyChangeSupport = new java.beans.PropertyChangeSupport(this)"
Also adds support methods:
public void addPropertyChangeListener(java.beans.PropertyChangeListener)
public void addPropertyChangeListener(String, java.beans.PropertyChangeListener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(String, java.beans.PropertyChangeListener)
public java.beans.PropertyChangeListener[] getPropertyChangeListeners()
Statement createBindableStatement(PropertyNode propertyNode, Expression fieldExpression)
pcsField.firePropertyChange("field", field, field = value)
void createListenerSetter(SourceUnit source, AnnotationNode node, ClassNode classNode, PropertyNode propertyNode)
void createSetterMethod(ClassNode declaringClass, PropertyNode propertyNode, String setterName, Statement setterBlock)
public static boolean hasBindableAnnotation(AnnotatedNode node)
boolean needsPropertyChangeSupport(ClassNode declaringClass)
public void visit(def nodes, SourceUnit source)