VetoableChangeSupport

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## java.beans
Class VetoableChangeSupport

    java.lang.Object
      java.beans.VetoableChangeSupport

All Implemented Interfaces:
  Serializable

    public class VetoableChangeSupport

extends Object
implements Serializable

This is a utility class that can be used by beans that support constrained properties. You can use an instance of this class as a member field of your bean and delegate various work to it. This class is serializable. When it is serialized it will save (and restore) any listeners that are themselves serializable. Any non-serializable listeners will be skipped during serialization.

See Also:
  Serialized Form

Constructor Summary
`VetoableChangeSupport(Object sourceBean)` Constructs a `VetoableChangeSupport` object.

Method Summary
`void` | `addVetoableChangeListener(VetoableChangeListener listener)` Add a VetoableListener to the listener list.
`void` | `fireVetoableChange(String propertyName, Object oldValue, Object newValue)` Report a vetoable property update to any registered listeners.
`VetoableChangeListener[]` | `getVetoableChangeListeners()` Returns the list of VetoableChangeListeners.
`void` | `removeVetoableChangeListener(VetoableChangeListener listener)` Remove a VetoableChangeListener from the listener list.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### VetoableChangeSupport

    public VetoableChangeSupport(Object sourceBean)

  Constructs a `VetoableChangeSupport` object.

  Parameters:
    `sourceBean` - The bean to be given as the source for any events.

Method Detail

### addVetoableChangeListener

    public void addVetoableChangeListener(VetoableChangeListener listener)

  Add a VetoableListener to the listener list. The listener is registered for all properties.

  Parameters:
    `listener` - The VetoableChangeListener to be added

### removeVetoableChangeListener

    public void removeVetoableChangeListener(VetoableChangeListener listener)

  Remove a VetoableChangeListener from the listener list. This removes a VetoableChangeListener that was registered for all properties.

  Parameters:
    `listener` - The VetoableChangeListener to be removed

### getVetoableChangeListeners

    public VetoableChangeListener[] getVetoableChangeListeners()

  Returns the list of VetoableChangeListeners.

  Returns:
    List of VetoableChangeListeners
  Since:
    1.4

### fireVetoableChange

    public void fireVetoableChange(String propertyName,
                                   Object oldValue,
                                   Object newValue)
                            throws PropertyVetoException

  Report a vetoable property update to any registered listeners. If anyone vetos the change, then fire a new event reverting everyone to the old value and then rethrow the PropertyVetoException.

  No event is fired if old and new are equal and non-null.

  Parameters:
    `propertyName` - The programmatic name of the property that is about to change..
    `oldValue` - The old value of the property.
    `newValue` - The new value of the property.
  Throws:
    `PropertyVetoException` - if the recipient wishes the property change to be rolled back.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD