Package org.nuiton.jaxx.application.bean
Interface JavaBeanObject
public interface JavaBeanObject
Created on 8/12/14.
- Since:
- 2.10
- Author:
- Tony Chemit - chemit@codelutin.com
-
Method Summary
Modifier and Type Method Description voidaddPropertyChangeListener(PropertyChangeListener listener)Add a PropertyChangeListener to the listener list.voidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener)Add a PropertyChangeListener for a specific property.voidfirePropertyChanged(String propertyName, Object oldValue, Object newValue)PropertyChangeListener[]getPropertyChangeListeners()Returns an array of all the listeners that were added to the PropertyChangeSupport object with addPropertyChangeListener().PropertyChangeListener[]getPropertyChangeListeners(String propertyName)Returns an array of all the listeners which have been associated with the named property.voidremovePropertyChangeListener(PropertyChangeListener listener)Remove a PropertyChangeListener from the listener list.voidremovePropertyChangeListener(String propertyName, PropertyChangeListener listener)Remove a PropertyChangeListener for a specific property.
-
Method Details
-
addPropertyChangeListener
Add a PropertyChangeListener to the listener list. The listener is registered for all properties. The same listener object may be added more than once, and will be called as many times as it is added. Iflisteneris null, no exception is thrown and no action is taken.- Parameters:
listener- The PropertyChangeListener to be added
-
removePropertyChangeListener
Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties. Iflistenerwas added more than once to the same event source, it will be notified one less time after being removed. Iflisteneris null, or was never added, no exception is thrown and no action is taken.- Parameters:
listener- The PropertyChangeListener to be removed
-
getPropertyChangeListeners
PropertyChangeListener[] getPropertyChangeListeners()Returns an array of all the listeners that were added to the PropertyChangeSupport object with addPropertyChangeListener().If some listeners have been added with a named property, then the returned array will be a mixture of PropertyChangeListeners and
PropertyChangeListenerProxys. If the calling method is interested in distinguishing the listeners then it must test each element to see if it's aPropertyChangeListenerProxy, perform the cast, and examine the parameter.PropertyChangeListener[] listeners = bean.getPropertyChangeListeners(); for (int i = 0; i < listeners.length; i++) { if (listeners[i] instanceof PropertyChangeListenerProxy) { PropertyChangeListenerProxy proxy = (PropertyChangeListenerProxy)listeners[i]; if (proxy.getPropertyName().equals("foo")) { // proxy is a PropertyChangeListener which was associated // with the property named "foo" } } }- Returns:
- all of the
PropertyChangeListenersadded or an empty array if no listeners have been added - See Also:
PropertyChangeListenerProxy
-
addPropertyChangeListener
Add a PropertyChangeListener for a specific property. The listener will be invoked only when a call on firePropertyChange names that specific property. The same listener object may be added more than once. For each property, the listener will be invoked the number of times it was added for that property. IfpropertyNameorlisteneris null, no exception is thrown and no action is taken.- Parameters:
propertyName- The name of the property to listen on.listener- The PropertyChangeListener to be added
-
removePropertyChangeListener
Remove a PropertyChangeListener for a specific property. Iflistenerwas added more than once to the same event source for the specified property, it will be notified one less time after being removed. IfpropertyNameis null, no exception is thrown and no action is taken. Iflisteneris null, or was never added for the specified property, no exception is thrown and no action is taken.- Parameters:
propertyName- The name of the property that was listened on.listener- The PropertyChangeListener to be removed
-
getPropertyChangeListeners
Returns an array of all the listeners which have been associated with the named property.- Parameters:
propertyName- The name of the property being listened to- Returns:
- all of the
PropertyChangeListenersassociated with the named property. If no such listeners have been added, or ifpropertyNameis null, an empty array is returned.
-
firePropertyChanged
-