|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sourceforge.esw.util.SupportObject
Provides basic abilities to an data-centric Object.
This SupportObject
implementation is the default
implementation of the ISupportObject
interface.
Defines several basic elements required for a data-centric Object. Those elements help a data Object fit within pieces of the Java Beans specification, and provide other useful things.
This ISupportObject
instance provides support for bound
and contrained properties on a Java Bean. Support for bound
properties provide a way to notify interested parties when an attempt is
made to change an instance's bound property. The
VetoableChangeListener
class allows applications to control the
semantics of whether a change to a contrained property is permitted.
See the current Java Beans specifications for more information.
There is also support for a property scratchpad containing key/value
pairs which can be used to associate values with this
ISupportObject
instance. For any given ISupportObject instance,
the property keys are unique (though values need not be).
This ISupportObject
allows an optional identifier to be assigned
to the ISupportObject
instance. Identifiers can be used to
distinguish, categorize, or label instances within a collection; however,
identifiers need not be unique within a collection.
Field Summary | |
protected java.lang.Object |
id
The identifier for this SupportObject instance. |
protected java.util.HashMap |
properties
The dynamic properties for this SupportObject instance. |
protected java.util.Hashtable |
propertyChildren
Associates listeners with the property that concerns them. |
protected ListenerSupport |
propertyListeners
Provides support for the PropertyChangeListeners for this
SupportObject instance. |
protected java.util.Hashtable |
vetoableChildren
Associates listeners with the property that concerns them. |
protected ListenerSupport |
vetoableListeners
Provides support for the VetoableChangeListeners for this
SupportObject instance. |
Constructor Summary | |
SupportObject()
Creates a new SupportObject instance. |
Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener aListener)
Adds a PropertyChangeListener to this
ISupportObject instance. |
void |
addPropertyChangeListener(java.lang.String aPropertyName,
java.beans.PropertyChangeListener aListener)
Adds a PropertyChangeListener to this
ISupportObject instance for the specified property. |
void |
addVetoableChangeListener(java.lang.String aPropertyName,
java.beans.VetoableChangeListener aListener)
Adds a VetoableChangeListener to this
ISupportObject instance for the specified property. |
void |
addVetoableChangeListener(java.beans.VetoableChangeListener aListener)
Adds a VetoableChangeListener to this
ISupportObject instance. |
void |
firePropertyChange(java.beans.PropertyChangeEvent aEvent)
Fires a PropertyChangeEvent from this
ISupportObject instance. |
void |
firePropertyChange(java.lang.String aPropertyName,
java.lang.Object aOldValue,
java.lang.Object aNewValue)
Fires a PropertyChangeEvent from this
ISupportObject instance. |
void |
fireVetoableChange(java.beans.PropertyChangeEvent aEvent)
Fires a vetoable PropertyChangeEvent from this
ISupportObject instance. |
void |
fireVetoableChange(java.lang.String aPropertyName,
java.lang.Object aOldValue,
java.lang.Object aNewValue)
Fires a vetoable PropertyChangeEvent from this
ISupportObject instance. |
java.lang.Object |
getID()
Returns the identifier for this ISupportObject
instance. |
java.lang.Object |
getProperty(java.lang.Object aKey)
Returns the value of the property specified by the given Object for this ISupportObject instance. |
int |
getPropertySize()
Returns the number of properties associated with this ISupportObject instance. |
java.util.Iterator |
propertyKeys()
Returns an Iterator instance over the property keys in this
ISupportObject instance. |
java.lang.Object |
removeProperty(java.lang.Object aKey)
Removes the property specified by the gien Object key for this
ISupportObject instance, and returns the value mapped to the
specified Object key. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener aListener)
Removes the specified PropertyChangeListener from this
ISupportObject instance. |
void |
removePropertyChangeListener(java.lang.String aPropertyName,
java.beans.PropertyChangeListener aListener)
Removes the specified PropertyChangeListener from this
ISupportObject instance for the specified property. |
void |
removeVetoableChangeListener(java.lang.String aPropertyName,
java.beans.VetoableChangeListener aListener)
Removes the specified VetoableChangeListener from this
ISupportObject instance for the specified property. |
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener aListener)
Removes the specified VetoableChangeListener from this
ISupportObject instance. |
void |
setID(java.lang.Object aId)
Sets this ISupportObject instance's identifier. |
void |
setProperty(java.lang.Object aKey,
java.lang.Object aValue)
Sets the specified key/value property on this ISupportObject
instance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected transient ListenerSupport propertyListeners
PropertyChangeListeners
for this
SupportObject
instance.protected transient ListenerSupport vetoableListeners
VetoableChangeListeners
for this
SupportObject
instance.protected java.util.Hashtable propertyChildren
ListenerSupport
objects.protected java.util.Hashtable vetoableChildren
ListenerSupport
objects.protected java.util.HashMap properties
SupportObject
instance.protected java.lang.Object id
SupportObject
instance.Constructor Detail |
public SupportObject()
SupportObject
instance.Method Detail |
public void addPropertyChangeListener(java.beans.PropertyChangeListener aListener)
PropertyChangeListener
to this
ISupportObject
instance.addPropertyChangeListener
in interface ISupportObject
aListener
- the PropertyChangeListener
to be added.removePropertyChangeListener( PropertyChangeListener )
public void addPropertyChangeListener(java.lang.String aPropertyName, java.beans.PropertyChangeListener aListener)
PropertyChangeListener
to this
ISupportObject
instance for the specified property.addPropertyChangeListener
in interface ISupportObject
aPropertyName
- the property to which to add the Listener.aListener
- the PropertyChangeListener
to be added.removePropertyChangeListener( String, PropertyChangeListener )
public void addVetoableChangeListener(java.beans.VetoableChangeListener aListener)
VetoableChangeListener
to this
ISupportObject
instance.addVetoableChangeListener
in interface ISupportObject
aListener
- the VetoableChangeListener
to be added.removePropertyChangeListener( PropertyChangeListener )
public void addVetoableChangeListener(java.lang.String aPropertyName, java.beans.VetoableChangeListener aListener)
VetoableChangeListener
to this
ISupportObject
instance for the specified property.addVetoableChangeListener
in interface ISupportObject
aPropertyName
- the property to which to add the Listener.aListener
- the VetoableChangeListener
to be added.removePropertyChangeListener( String, PropertyChangeListener )
public void removePropertyChangeListener(java.beans.PropertyChangeListener aListener)
PropertyChangeListener
from this
ISupportObject
instance.removePropertyChangeListener
in interface ISupportObject
aListener
- the PropertyChangeListener
to be removed.addPropertyChangeListener( PropertyChangeListener )
public void removePropertyChangeListener(java.lang.String aPropertyName, java.beans.PropertyChangeListener aListener)
PropertyChangeListener
from this
ISupportObject
instance for the specified property.removePropertyChangeListener
in interface ISupportObject
aPropertyName
- the property to which to remove the Listener.aListener
- the PropertyChangeListener
to be removed.addPropertyChangeListener( String, PropertyChangeListener )
public void removeVetoableChangeListener(java.beans.VetoableChangeListener aListener)
VetoableChangeListener
from this
ISupportObject
instance.removeVetoableChangeListener
in interface ISupportObject
aListener
- the VetoableChangeListener
to be removed.addVetoableChangeListener( VetoableChangeListener )
public void removeVetoableChangeListener(java.lang.String aPropertyName, java.beans.VetoableChangeListener aListener)
VetoableChangeListener
from this
ISupportObject
instance for the specified property.removeVetoableChangeListener
in interface ISupportObject
aPropertyName
- the property to which to remove the Listener.aListener
- the VetoableChangeListener
to be removed.addVetoableChangeListener( String, VetoableChangeListener )
public void setProperty(java.lang.Object aKey, java.lang.Object aValue)
ISupportObject
instance.setProperty
in interface ISupportObject
aKey
- The key of the property being added.aValue
- The value of the property being added.
Examples:
String key = "name"; String value = "Smith"; dataObject.setProperty( key, value );
getProperty( Object )
,
removeProperty( Object )
,
propertyKeys()
,
getPropertySize()
public java.lang.Object getProperty(java.lang.Object aKey)
Object
for this ISupportObject
instance.getProperty
in interface ISupportObject
aKey
- the key identifying the value to return.Object
key.
Examples:
String value = dataObject.getProperty( "name" );
setProperty( Object, Object )
,
removeProperty( Object )
,
propertyKeys()
,
getPropertySize()
public java.lang.Object removeProperty(java.lang.Object aKey)
Object
key for this
ISupportObject
instance, and returns the value mapped to the
specified Object
key.removeProperty
in interface ISupportObject
aKey
- The key of the key/value pair to removeString value = dataObject.removeProperty( "name" );
setProperty( Object, Object )
,
getProperty( Object )
,
propertyKeys()
,
getPropertySize()
public java.util.Iterator propertyKeys()
Iterator
instance over the property keys in this
ISupportObject
instance.propertyKeys
in interface ISupportObject
Iterator
of the keys in this
ISupportObject
instance.
Examples:
Iterator iterator = dataObject.propertyKeys(); while ( iterator.hasNext() ) { Object aKey = iterator.next(); // do something with the key... }
setProperty( Object, Object )
,
getProperty( Object )
,
removeProperty( Object )
,
getPropertySize()
public int getPropertySize()
ISupportObject
instance.getPropertySize
in interface ISupportObject
ISupportObject
instance.
Examples:
int numberOfProperties = dataObject.propertySize();
setProperty( Object, Object )
,
getProperty( Object )
,
removeProperty( Object )
,
propertyKeys()
public void setID(java.lang.Object aId)
ISupportObject
instance's identifier. If an
identifier is not specified, a numeric identifier will be provided. The
ESW framework provides numeric identifiers which are unique within this
instance of the Java Virtual Machine
Fires a IUtilResources.ID_PROPERTY
property change event.
setID
in interface ISupportObject
aId
- the unique Id for this ISupportObject
instance.getID( )
public java.lang.Object getID()
ISupportObject
instance.getID
in interface ISupportObject
ISupportObject
instance.setID( Object )
public void firePropertyChange(java.lang.String aPropertyName, java.lang.Object aOldValue, java.lang.Object aNewValue)
PropertyChangeEvent
from this
ISupportObject
instance.firePropertyChange
in interface ISupportObject
aPropertyName
- the property for which to fire the event.aOldValue
- the old value for the event.aNewValue
- the new value for the event.public void firePropertyChange(java.beans.PropertyChangeEvent aEvent)
PropertyChangeEvent
from this
ISupportObject
instance.firePropertyChange
in interface ISupportObject
aEvent
- the event to fire.public void fireVetoableChange(java.lang.String aPropertyName, java.lang.Object aOldValue, java.lang.Object aNewValue) throws java.beans.PropertyVetoException
PropertyChangeEvent
from this
ISupportObject
instance.fireVetoableChange
in interface ISupportObject
aPropertyName
- the property for which to fire the event.aOldValue
- the old value for the event.aNewValue
- the new value for the event.public void fireVetoableChange(java.beans.PropertyChangeEvent aEvent) throws java.beans.PropertyVetoException
PropertyChangeEvent
from this
ISupportObject
instance.fireVetoableChange
in interface ISupportObject
aEvent
- the event to fire.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |