org.apache.pivot.tools.wtk
Class BeanMonitor

java.lang.Object
  extended by org.apache.pivot.tools.wtk.BeanMonitor

public class BeanMonitor
extends Object

Class for monitoring Java bean property changes.


Field Summary
static String LISTENERS_SUFFIX
           
static String PROPERTY_CHANGE_SUFFIX
           
 
Constructor Summary
BeanMonitor()
           
BeanMonitor(Object bean)
           
 
Method Summary
 Object getBean()
          Returns the bean object that this monitor wraps.
 ListenerList<PropertyChangeListener> getPropertyChangeListeners()
           
 boolean isNotifying(String key)
          Tells whether or not the specified property fires change events.
 void setBean(Object bean)
          Sets the bean object that this monitor will wrap.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LISTENERS_SUFFIX

public static final String LISTENERS_SUFFIX
See Also:
Constant Field Values

PROPERTY_CHANGE_SUFFIX

public static final String PROPERTY_CHANGE_SUFFIX
See Also:
Constant Field Values
Constructor Detail

BeanMonitor

public BeanMonitor()

BeanMonitor

public BeanMonitor(Object bean)
Method Detail

getBean

public Object getBean()
Returns the bean object that this monitor wraps.


setBean

public void setBean(Object bean)
Sets the bean object that this monitor will wrap.

NOTE: failing to clear the bean of a bean monitor may result in memory leaks, as the bean object may maintain references to the bean monitor as long as it is set.

Parameters:
bean - The bean object, or null to clear the bean.

isNotifying

public boolean isNotifying(String key)
Tells whether or not the specified property fires change events.

Parameters:
key - The property name.
Returns:
true if the property fires change events; false otherwise.

getPropertyChangeListeners

public ListenerList<PropertyChangeListener> getPropertyChangeListeners()