org.progeeks.util.beans
Class PropertyHolder

java.lang.Object
  extended by org.progeeks.util.beans.BeanChangeSupport
      extended by org.progeeks.util.beans.PropertyHolder
All Implemented Interfaces:
java.io.Serializable, StandardBean
Direct Known Subclasses:
DefaultTestContext

public class PropertyHolder
extends BeanChangeSupport
implements java.io.Serializable

Object that holds and provides access to a set of properties the can be set or retrieved based on name.

Version:
$Revision: 1.3 $
Author:
Paul Speed
See Also:
Serialized Form

Constructor Summary
PropertyHolder()
          Creates a new property container that can track various properties by name and report events when they change.
PropertyHolder(BeanChangeSupport delegate)
          Creates a new property container that can track various properties by name and report events when they change to both its own listeners and to the specified delegate object.
 
Method Summary
 boolean getBooleanProperty(java.lang.String property, boolean defaultValue)
          Retrieves the boolean-typed property value for the specified property name.
 double getDoubleProperty(java.lang.String property, double defaultValue)
          Retrieves the double-typed property value for the specified property name.
 float getFloatProperty(java.lang.String property, float defaultValue)
          Retrieves the float-typed property value for the specified property name.
 int getIntProperty(java.lang.String property, int defaultValue)
          Retrieves the int-typed property value for the specified property name.
 long getLongProperty(java.lang.String property, long defaultValue)
          Retrieves the long-typed property value for the specified property name.
 java.lang.Object getObjectProperty(java.lang.String property)
          Retrieves the object-typed property value for the specified property name.
 java.lang.Object getObjectProperty(java.lang.String property, java.lang.Object defaultValue)
          Retrieves the object-typed property value for the specified property name.
 java.lang.String getStringProperty(java.lang.String property, java.lang.String defaultValue)
          Retrieves the string-typed property value for the specified property name.
 boolean setBooleanProperty(java.lang.String property, boolean b)
          Sets the specified property to the specified value firing a change notification as appropriate.
 boolean setDoubleProperty(java.lang.String property, double d)
          Sets the specified property to the specified value firing a change notification as appropriate.
 boolean setFloatProperty(java.lang.String property, float d)
          Sets the specified property to the specified value firing a change notification as appropriate.
 boolean setIntProperty(java.lang.String property, int i)
          Sets the specified property to the specified value firing a change notification as appropriate.
 boolean setLongProperty(java.lang.String property, long l)
          Sets the specified property to the specified value firing a change notification as appropriate.
 boolean setObjectProperty(java.lang.String property, java.lang.Object obj)
          Sets the specified property to the specified value firing a change notification as appropriate.
 boolean setStringProperty(java.lang.String property, java.lang.String value)
          Sets the specified property to the specified value firing a change notification as appropriate.
 
Methods inherited from class org.progeeks.util.beans.BeanChangeSupport
addPropertyChangeListener, addPropertyChangeListener, clearAllListeners, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, hasListeners, hasListeners, removePropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyHolder

public PropertyHolder()
Creates a new property container that can track various properties by name and report events when they change.


PropertyHolder

public PropertyHolder(BeanChangeSupport delegate)
Creates a new property container that can track various properties by name and report events when they change to both its own listeners and to the specified delegate object.

Method Detail

setObjectProperty

public boolean setObjectProperty(java.lang.String property,
                                 java.lang.Object obj)
Sets the specified property to the specified value firing a change notification as appropriate.


getObjectProperty

public java.lang.Object getObjectProperty(java.lang.String property)
Retrieves the object-typed property value for the specified property name.


getObjectProperty

public java.lang.Object getObjectProperty(java.lang.String property,
                                          java.lang.Object defaultValue)
Retrieves the object-typed property value for the specified property name. The defaultValue is returned if the property value does not exist. Note: this is different than being null.


setStringProperty

public boolean setStringProperty(java.lang.String property,
                                 java.lang.String value)
Sets the specified property to the specified value firing a change notification as appropriate. This is a convenience method and defers to the Object-based method.


getStringProperty

public java.lang.String getStringProperty(java.lang.String property,
                                          java.lang.String defaultValue)
Retrieves the string-typed property value for the specified property name. The defaultValue is returned if the property value does not exist. This is a convenience method and defers to the Object-based method.


setIntProperty

public boolean setIntProperty(java.lang.String property,
                              int i)
Sets the specified property to the specified value firing a change notification as appropriate. This is a convenience method and defers to the Object-based method.


getIntProperty

public int getIntProperty(java.lang.String property,
                          int defaultValue)
Retrieves the int-typed property value for the specified property name. The defaultValue is returned if the property value does not exist. This is a convenience method and defers to the Object-based method.


setLongProperty

public boolean setLongProperty(java.lang.String property,
                               long l)
Sets the specified property to the specified value firing a change notification as appropriate. This is a convenience method and defers to the Object-based method.


getLongProperty

public long getLongProperty(java.lang.String property,
                            long defaultValue)
Retrieves the long-typed property value for the specified property name. The defaultValue is returned if the property value does not exist. This is a convenience method and defers to the Object-based method.


setDoubleProperty

public boolean setDoubleProperty(java.lang.String property,
                                 double d)
Sets the specified property to the specified value firing a change notification as appropriate. This is a convenience method and defers to the Object-based method.


getDoubleProperty

public double getDoubleProperty(java.lang.String property,
                                double defaultValue)
Retrieves the double-typed property value for the specified property name. The defaultValue is returned if the property value does not exist. This is a convenience method and defers to the Object-based method.


setFloatProperty

public boolean setFloatProperty(java.lang.String property,
                                float d)
Sets the specified property to the specified value firing a change notification as appropriate. This is a convenience method and defers to the Object-based method.


getFloatProperty

public float getFloatProperty(java.lang.String property,
                              float defaultValue)
Retrieves the float-typed property value for the specified property name. The defaultValue is returned if the property value does not exist. This is a convenience method and defers to the Object-based method.


setBooleanProperty

public boolean setBooleanProperty(java.lang.String property,
                                  boolean b)
Sets the specified property to the specified value firing a change notification as appropriate. This is a convenience method and defers to the Object-based method.


getBooleanProperty

public boolean getBooleanProperty(java.lang.String property,
                                  boolean defaultValue)
Retrieves the boolean-typed property value for the specified property name. The defaultValue is returned if the property value does not exist. This is a convenience method and defers to the Object-based method.



Copyright © 2002-2003 Paul Speed. All Rights Reserved.