net.sourceforge.esw.util
Interface ISupportObject

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
IFilterEngine, IHeartbeatGenerator, ILog, ILogDissemination, IMetaCollection, INode, IPropertyAggregator, IPropertySource, IService, ITableAdapter
All Known Implementing Classes:
SupportObject, SupportObjectProxy

public interface ISupportObject
extends java.io.Serializable

Provides basic abilities to an data-centric Object.

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.


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.
 

Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener aListener)
Adds a PropertyChangeListener to this ISupportObject instance.
Parameters:
aListener - the PropertyChangeListener to be added.
See Also:
removePropertyChangeListener( PropertyChangeListener )

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String aPropertyName,
                                      java.beans.PropertyChangeListener aListener)
Adds a PropertyChangeListener to this ISupportObject instance for the specified property.
Parameters:
aPropertyName - the property to which to add the Listener.
aListener - the PropertyChangeListener to be added.
See Also:
removePropertyChangeListener( String, PropertyChangeListener )

addVetoableChangeListener

public void addVetoableChangeListener(java.beans.VetoableChangeListener aListener)
Adds a VetoableChangeListener to this ISupportObject instance.
Parameters:
aListener - the VetoableChangeListener to be added.
See Also:
removePropertyChangeListener( PropertyChangeListener )

addVetoableChangeListener

public void addVetoableChangeListener(java.lang.String aPropertyName,
                                      java.beans.VetoableChangeListener aListener)
Adds a VetoableChangeListener to this ISupportObject instance for the specified property.
Parameters:
aPropertyName - the property to which to add the Listener.
aListener - the VetoableChangeListener to be added.
See Also:
removePropertyChangeListener( String, PropertyChangeListener )

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener aListener)
Removes the specified PropertyChangeListener from this ISupportObject instance.
Parameters:
aListener - the PropertyChangeListener to be removed.
See Also:
addPropertyChangeListener( PropertyChangeListener )

removePropertyChangeListener

public void removePropertyChangeListener(java.lang.String aPropertyName,
                                         java.beans.PropertyChangeListener aListener)
Removes the specified PropertyChangeListener from this ISupportObject instance for the specified property.
Parameters:
aPropertyName - the property to which to remove the Listener.
aListener - the PropertyChangeListener to be removed.
See Also:
addPropertyChangeListener( String, PropertyChangeListener )

removeVetoableChangeListener

public void removeVetoableChangeListener(java.beans.VetoableChangeListener aListener)
Removes the specified VetoableChangeListener from this ISupportObject instance.
Parameters:
aListener - the VetoableChangeListener to be removed.
See Also:
addVetoableChangeListener( VetoableChangeListener )

removeVetoableChangeListener

public void removeVetoableChangeListener(java.lang.String aPropertyName,
                                         java.beans.VetoableChangeListener aListener)
Removes the specified VetoableChangeListener from this ISupportObject instance for the specified property.
Parameters:
aPropertyName - the property to which to remove the Listener.
aListener - the VetoableChangeListener to be removed.
See Also:
addVetoableChangeListener( String, VetoableChangeListener )

setProperty

public void setProperty(java.lang.Object aKey,
                        java.lang.Object aValue)
Sets the specified key/value property on this ISupportObject instance.
Parameters:
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 );
 
See Also:
getProperty( Object ), removeProperty( Object ), propertyKeys(), getPropertySize()

getProperty

public java.lang.Object getProperty(java.lang.Object aKey)
Returns the value of the property specified by the given Object for this ISupportObject instance.
Parameters:
aKey - the key identifying the value to return.
Returns:
the value of the specified Object key. Examples:
   String value = dataObject.getProperty( "name" );
 
See Also:
setProperty( Object, Object ), removeProperty( Object ), propertyKeys(), getPropertySize()

removeProperty

public 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.
Parameters:
aKey - The key of the key/value pair to remove
Returns:
the value of the aKey in the key/value pair Examples:
   String value = dataObject.removeProperty( "name" );
 
See Also:
setProperty( Object, Object ), getProperty( Object ), propertyKeys(), getPropertySize()

propertyKeys

public java.util.Iterator propertyKeys()
Returns an Iterator instance over the property keys in this ISupportObject instance.
Returns:
an 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...
   }
 
See Also:
setProperty( Object, Object ), getProperty( Object ), removeProperty( Object ), getPropertySize()

getPropertySize

public int getPropertySize()
Returns the number of properties associated with this ISupportObject instance.
Returns:
the number of properties in this ISupportObject instance. Examples:
   int numberOfProperties = dataObject.propertySize();
 
See Also:
setProperty( Object, Object ), getProperty( Object ), removeProperty( Object ), propertyKeys()

setID

public void setID(java.lang.Object aId)
Sets this 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.

Parameters:
aId - the unique Id for this ISupportObject instance.
See Also:
getID( )

getID

public java.lang.Object getID()
Returns the identifier for this ISupportObject instance.
Returns:
the unique Id for this ISupportObject instance.
See Also:
setID( Object )

firePropertyChange

public void firePropertyChange(java.lang.String aPropertyName,
                               java.lang.Object aOldValue,
                               java.lang.Object aNewValue)
Fires a PropertyChangeEvent from this ISupportObject instance.
Parameters:
aPropertyName - the property for which to fire the event.
aOldValue - the old value for the event.
aNewValue - the new value for the event.

firePropertyChange

public void firePropertyChange(java.beans.PropertyChangeEvent aEvent)
Fires a PropertyChangeEvent from this ISupportObject instance.
Parameters:
aEvent - the event to fire.

fireVetoableChange

public void fireVetoableChange(java.lang.String aPropertyName,
                               java.lang.Object aOldValue,
                               java.lang.Object aNewValue)
                        throws java.beans.PropertyVetoException
Fires a vetoable PropertyChangeEvent from this ISupportObject instance.
Parameters:
aPropertyName - the property for which to fire the event.
aOldValue - the old value for the event.
aNewValue - the new value for the event.

fireVetoableChange

public void fireVetoableChange(java.beans.PropertyChangeEvent aEvent)
                        throws java.beans.PropertyVetoException
Fires a vetoable PropertyChangeEvent from this ISupportObject instance.
Parameters:
aEvent - the event to fire.


Copyright 2002 Free Software Foundation. All Rights Reserved.