java.beans
Class VetoableChangeListenerProxy

java.lang.Object
  extended by java.util.EventListenerProxy
      extended by java.beans.VetoableChangeListenerProxy
All Implemented Interfaces:
VetoableChangeListener, EventListener

public class VetoableChangeListenerProxy
extends EventListenerProxy
implements VetoableChangeListener

This class provides an extension to VetoableChangeListener - associating a name with the listener. This can be used to filter the changes that one is interested in.

Since:
1.4

Constructor Summary
VetoableChangeListenerProxy(String propertyName, VetoableChangeListener listener)
          Create a new proxy which filters property change events and only passes changes to the named property on to the delegate.
 
Method Summary
 String getPropertyName()
          Gets the name of the property this proxy is filtering on.
 void vetoableChange(PropertyChangeEvent event)
          Forwards the event on to the delegate if the property name matches.
 
Methods inherited from class java.util.EventListenerProxy
getListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VetoableChangeListenerProxy

public VetoableChangeListenerProxy(String propertyName,
                                   VetoableChangeListener listener)
Create a new proxy which filters property change events and only passes changes to the named property on to the delegate.

Parameters:
propertyName - the property's name to filter on
listener - the delegate listener
Method Detail

vetoableChange

public void vetoableChange(PropertyChangeEvent event)
                    throws PropertyVetoException
Forwards the event on to the delegate if the property name matches.

Specified by:
vetoableChange in interface VetoableChangeListener
Parameters:
event - the event to pass on, if it meets the filter
Throws:
NullPointerException - if the delegate this was created with is null
PropertyVetoException - if the change is vetoed by the listener

getPropertyName

public String getPropertyName()
Gets the name of the property this proxy is filtering on.

Returns:
the property name