|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.aop.support.IntroductionInfoSupport org.springframework.aop.support.DelegatingIntroductionInterceptor ch.elca.el4j.services.gui.model.mixin.PropertyChangeListenerMixin
public class PropertyChangeListenerMixin
Mixin to enable javaBeans event support and validation in ordinary POJOs.
To see each fired property change, set the log4j level for this class to
debug
It also contains a simple implementation of the SaveRestoreCapability
. All Java bean properties of
primitive or immutable (see IMMUTABLE_CLASSES) type can be saved and restored.
Field Summary | |
---|---|
protected Map<Method,Object> |
m_backup
The stored properties (a map containing the setter-method and its value). |
protected PropertyChangeSupport |
m_changeSupport
The support for property change notification. |
protected org.hibernate.validator.ClassValidator |
m_classValidator
Hibernate class validator. |
protected Map<Method,Method> |
m_methodCache
Getter-to-setter/setter-to-getter method cache. |
protected boolean |
m_writeBack
Should bean property be overwritten by proxied property to speed up following accesses? |
Fields inherited from class org.springframework.aop.support.IntroductionInfoSupport |
---|
publishedInterfaces |
Constructor Summary | |
---|---|
PropertyChangeListenerMixin()
The constructor. |
Method Summary | ||
---|---|---|
void |
addPropertyChangeListener(PropertyChangeListener l)
|
|
void |
addPropertyChangeListener(String key,
PropertyChangeListener l)
|
|
static
|
addPropertyChangeMixin(List<T> list)
Wrap a list with the change tracking mixin. |
|
static
|
addPropertyChangeMixin(Map<K,V> map)
Wrap a map with the change tracking mixin. |
|
static
|
addPropertyChangeMixin(T object)
Wrap an object with the change tracking mixin. |
|
protected Object |
applyMixinToResult(Object object)
Add property change listeners to result of method invocation. |
|
protected void |
firePropertyChange(String key,
Object oldValue,
Object newValue)
|
|
org.hibernate.validator.ClassValidator |
getClassValidator()
|
|
protected Method |
getGetter(Method setter)
|
|
protected Method |
getSetter(Method getter)
|
|
Object |
invoke(org.aopalliance.intercept.MethodInvocation invocation)
|
|
boolean |
isValid()
|
|
boolean |
isValid(String property)
|
|
void |
removePropertyChangeListener(PropertyChangeListener l)
|
|
void |
removePropertyChangeListener(String key,
PropertyChangeListener l)
|
|
void |
restore()
Restore all the writable java bean properties. |
|
void |
save()
Save all the writable java bean properties. |
Methods inherited from class org.springframework.aop.support.DelegatingIntroductionInterceptor |
---|
doProceed |
Methods inherited from class org.springframework.aop.support.IntroductionInfoSupport |
---|
getInterfaces, implementInterfacesOnObject, implementsInterface, isMethodOnIntroducedInterface, suppressInterface |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.springframework.aop.DynamicIntroductionAdvice |
---|
implementsInterface |
Field Detail |
---|
protected boolean m_writeBack
protected PropertyChangeSupport m_changeSupport
protected Map<Method,Method> m_methodCache
protected Map<Method,Object> m_backup
protected org.hibernate.validator.ClassValidator m_classValidator
Constructor Detail |
---|
public PropertyChangeListenerMixin()
Method Detail |
---|
public static <T> T addPropertyChangeMixin(T object)
T
- the object classobject
- the object to be wrapped
PropertyChangeListenerMixin
as Advisor
public static <T> List<T> addPropertyChangeMixin(List<T> list)
T
- the object classlist
- the list to be wrapped
ObservableList
public static <K,V> Map<K,V> addPropertyChangeMixin(Map<K,V> map)
K
- the key class of the mapV
- the value class of the mapmap
- the map to be wrapped
ObservableMap
public void addPropertyChangeListener(PropertyChangeListener l)
addPropertyChangeListener
in interface PropertyChangeListenerCapability
PropertyChangeSupport.addPropertyChangeListener(PropertyChangeListener)
public void removePropertyChangeListener(PropertyChangeListener l)
removePropertyChangeListener
in interface PropertyChangeListenerCapability
PropertyChangeSupport.removePropertyChangeListener(PropertyChangeListener)
public void addPropertyChangeListener(String key, PropertyChangeListener l)
addPropertyChangeListener
in interface PropertyChangeListenerCapability
PropertyChangeSupport.addPropertyChangeListener(String, PropertyChangeListener)
public void removePropertyChangeListener(String key, PropertyChangeListener l)
removePropertyChangeListener
in interface PropertyChangeListenerCapability
PropertyChangeSupport.removePropertyChangeListener(String, PropertyChangeListener)
protected void firePropertyChange(String key, Object oldValue, Object newValue)
public Object invoke(org.aopalliance.intercept.MethodInvocation invocation) throws Throwable
invoke
in interface org.aopalliance.intercept.MethodInterceptor
invoke
in class DelegatingIntroductionInterceptor
Throwable
protected Object applyMixinToResult(Object object)
object
- the result of the method invocation
protected Method getGetter(Method setter)
setter
- the setter method
protected Method getSetter(Method getter)
getter
- the getter method
public void save()
save
in interface SaveRestoreCapability
public void restore()
restore
in interface SaveRestoreCapability
public org.hibernate.validator.ClassValidator getClassValidator()
getClassValidator
in interface HibernateValidationCapability
public boolean isValid()
isValid
in interface org.jdesktop.swingbinding.validation.ValidationCapability
public boolean isValid(String property)
isValid
in interface org.jdesktop.swingbinding.validation.ValidationCapability
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |