All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.beans.dip.VetoableChangeSupport
java.lang.Object
|
+----com.ibm.beans.dip.VetoableChangeSupport
- public class VetoableChangeSupport
- extends Object
- implements Serializable
This utility class is based on java.beans.VetoableChangeSupport
.
The main difference between java.beans.VetoableChangeSupport
and
this class is that this class supports using
com.ibm.beans.util.Collections
to hold the listeners instead
of being hardcoded to use only a Vector. Also, the isEmpty()
and elements() methods were
added to this class to allow the user to see which listeners were
added.
- See Also:
- VetoableChangeSupport
-
VetoableChangeSupport(Object)
- Constructs a VetoableChangeSupport instance using the default Vector
implementation.
-
VetoableChangeSupport(Object, Collection)
- Constructs a VetoableChangeSupport instance using the input Collection.
-
addVetoableChangeListener(VetoableChangeListener)
- Adds a VetoableChangeListener to instance the listener list.
-
elements()
- Gets an enumeration of VetoableChangeListener instances.
-
fireVetoableChange(String, Object, Object)
- Reports a vetoable property update to any registered listeners.
-
isEmpty()
- Checks to see if the collection of listeners is empty.
-
removeVetoableChangeListener(VetoableChangeListener)
- Removes a VetoableChangeListener instance from the listener list.
VetoableChangeSupport
public VetoableChangeSupport(Object sourceBean)
- Constructs a VetoableChangeSupport instance using the default Vector
implementation.
- Parameters:
- sourceBean - The bean given as the source for any event.
VetoableChangeSupport
public VetoableChangeSupport(Object sourceBean,
Collection collection)
- Constructs a VetoableChangeSupport instance using the input Collection.
- Parameters:
- sourceBean - The bean given as the source for any event.
- collection - The Collection used to store the listeners.
addVetoableChangeListener
public synchronized void addVetoableChangeListener(VetoableChangeListener listener)
- Adds a VetoableChangeListener to instance the listener list.
- Parameters:
- listener - The listener to add.
removeVetoableChangeListener
public synchronized void removeVetoableChangeListener(VetoableChangeListener listener)
- Removes a VetoableChangeListener instance from the listener list.
- Parameters:
- listener - The listener to remove.
fireVetoableChange
public void fireVetoableChange(String propertyName,
Object oldValue,
Object newValue) throws PropertyVetoException
- Reports a vetoable property update to any registered listeners. If
anyone vetos the change, this method fires a new event reverting
everyone to
the old value and then rethrows the PropertyVetoException.
No event is fired if old and new are equal and non-null.
- Parameters:
- propertyName - The programmatic name of the changed property
- oldValue - The old value of the property.
- newValue - The new value of the property.
- Throws: PropertyVetoException
- May be thown if the
listener wants the property change to be
canceled.
elements
public final synchronized Enumeration elements()
- Gets an enumeration of VetoableChangeListener instances.
Use the Enumeration methods on
the returned object to fetch the elements sequentially.
- Returns:
- An enumeration of the listeners that will be fired in
the fireVetoableChange() method.
isEmpty
public final boolean isEmpty()
- Checks to see if the collection of listeners is empty.
- Returns:
-
true
if empty; false
otherwise.
All Packages Class Hierarchy This Package Previous Next Index