java.beans

Class PropertyChangeListenerProxy

public class PropertyChangeListenerProxy extends EventListenerProxy implements PropertyChangeListener

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

Since: 1.4

UNKNOWN: udpated to 1.4

Constructor Summary
PropertyChangeListenerProxy(String propertyName, PropertyChangeListener listener)
Create a new proxy which filters property change events and only passes changes to the named property on to the delegate.
Method Summary
StringgetPropertyName()
Gets the name of the property this proxy is filtering on.
voidpropertyChange(PropertyChangeEvent event)
Forwards the event on to the delegate if the property name matches.

Constructor Detail

PropertyChangeListenerProxy

public PropertyChangeListenerProxy(String propertyName, PropertyChangeListener listener)
Create a new proxy which filters property change events and only passes changes to the named property on to the delegate. A null propertyName or listener does not fail now, but may cause a NullPointerException down the road.

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

Method Detail

getPropertyName

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

Returns: the property name

propertyChange

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

Parameters: event the event to pass on, if it meets the filter

Throws: NullPointerException if the delegate this was created with is null