net.sourceforge.esw.properties
Class DefaultPropertyAggregator

java.lang.Object
  |
  +--net.sourceforge.esw.properties.DefaultPropertyAggregator
All Implemented Interfaces:
java.lang.Cloneable, ICloneable, INode, IPropertyAggregator, IPropertySource, ISupportObject, java.io.Serializable

public class DefaultPropertyAggregator
extends java.lang.Object
implements IPropertyAggregator

Provides aggregation acrosss multiple IPropertySource instances based on a ranking of those IPropertySource instances.

This DefaultPropertyAggregator class is the reference implementation of the IPropertyAggregator interface.

To provide the same abilities of a IPropertySource instance, this IPropertyAggregator instance extends the IPropertySource interface. The IPropertyAggregator instance decorates a collection of IPropertySource instances, delegating method calls the first IPropertySource instance with the highest ranking that returns a valid value.

Properties are any persistent data source that parameterizes behavior of a running application. That data source could be XML, a relational database, or even a URL.

To load properties from their data source, call the load method.

Properties can be read-only or writable. The setWriteable and isWriteable methods determine whether an IPropertySource instance is writeable.

If the properties represented by this IPropertySource instance are writable, then the save method saves the properties to the represented property source.

To allow easy access to Properties, this IPropertySource interface extends the INode interface.

This interface is the root of the Properties framework. It provides the container for the storage and manipulation of properties.

See Also:
PropertyManager, Serialized Form

Inner Class Summary
protected  class DefaultPropertyAggregator.SourcesIterator
           
 
Field Summary
protected  boolean bWriteable
          If true, this IPropertyAggregator instance is writeable.
protected  boolean bWriteableCached
          If true, this DefaultPropertyAggregator instance has determined if any of the aggregate IPropertySource instances contained by this IPropertyAggregator implementor is writeable.
protected  int largestRank
          The largest rank of the contained IPropertySource instances.
protected  java.util.HashMap sources
          The HashMap of IPropertySource instances that are contained by this IPropertyAggregator instance.
 
Constructor Summary
protected DefaultPropertyAggregator()
          Creates a new DefaultPropertyAggregator instance.
 
Method Summary
 void acceptVisitor(IGraphVisitor aVisitor)
          Requests that this INode instance accept the specified IGraphVisitor instance and that visiting of this INode struture begin.
 void add(INode aNode)
          Appends the specified INode child instance to the end of this INode instances child collection.
 void add(INode aNode, boolean bAddParent)
          Appends the specified INode child instance to the end of this INode instance's child collection.
 void addParent(INode aParent)
          Sets the parent INode instance for this INode instance.
 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 addPropertySource(int aRank, IPropertySource aPropertySource)
          Adds the specified IPropertySource instance to this IPropertyAggregator instance at the specified ranking, replacing the IPropertySource instance that was in that rank, if any.
 void addPropertySource(IPropertySource aPropertySource)
          Adds the specified IPropertySource instance to this IPropertyAggregator instance at the lowest ranking (at the end of the aggregate list).
 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 clear()
          Removes the children from this INode instance.
 java.lang.Object clone()
          Creates and returns a clone of the implementing Object.
 boolean containsID(java.lang.Object aId)
          Indicates whether this INode instance contains the specified identifer as a child of this INode instance.
protected  void findOutIfWriteable()
          Checks to see if any of the IPropertySource instances are writeable.
 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.
 INode get(int aIndex)
          Returns the INode child instance at the specified index.
 INode get(java.lang.Object aId)
          Returns the first INode child instance that contains specified identifer.
 java.lang.Object getID()
          Returns the identifier for this ISupportObject instance.
 java.util.List getList(java.lang.Object aId)
          Returns the List of INode child instances with the specified identifer.
protected  java.lang.Object getMethod(java.lang.reflect.Method aMethod, java.lang.Object[] args)
          Iterates through the IPropertySource instances and finds the first IPropertySource instance that returns a non-null result.
 INode getParent(int aIndex)
          Returns the INode parent instance at the specified index.
 java.util.Iterator getParents()
          Returns an Iterator over the INode parent instances of this INode 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.
 IPropertySource getPropertySource(int aRank)
          Returns the specified IPropertySource instance from this IPropertyAgregator instance at the specified ranking.
 IPropertySource getPropertySource(java.lang.Object aID)
          Returns the specified IPropertySource instance from this IPropertyAgregator instance with the specified identifier.
 java.util.Iterator getPropertySources()
          Returns the IPropertySource instances from this IPropertyAgregator instance.
 java.lang.Object getValue()
          Returns the value of this INode instance
 boolean isEmpty()
          Indicates whether this INode instance has no children.
 boolean isWriteable()
          Returns whether this IPropertySource instance is a writeable IPropertySource instance.
 java.util.Iterator iterator()
          Returns an Iterator over this INode instance's children.
 void load()
          Loads properties from the properties source represented by this IPropertySource instance.
 java.util.Iterator propertyKeys()
          Returns an Iterator instance over the property keys in this ISupportObject instance.
 void remove(INode aNode)
          Removes the INode child instance for the specified identifer from this INode instance if present.
 void removeParent(INode aParent)
          Removes the specified parent INode instance from this INode 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 removePropertySource(IPropertySource aPropertySource)
          Removes the specified IPropertySource instance from this IPropertyAgregator instance.
 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 save()
          Saves all modified properties to the properties source represented by this IPropertySource 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.
 void setValue(java.lang.Object aValue)
          Sets the value for this INode instance.
 void setWriteable(boolean aWriteable)
          Sets whether this IPropertySource instance is a writeable IPropertySource instance.
 int size()
          Returns the number of children in this INode instance.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bWriteable

protected boolean bWriteable
If true, this IPropertyAggregator instance is writeable. If false, this IPropertyAggregator instance is read-only.

bWriteableCached

protected boolean bWriteableCached
If true, this DefaultPropertyAggregator instance has determined if any of the aggregate IPropertySource instances contained by this IPropertyAggregator implementor is writeable. If false, none of the contained IPropertySource instances are writeable.

largestRank

protected int largestRank
The largest rank of the contained IPropertySource instances.

sources

protected java.util.HashMap sources
The HashMap of IPropertySource instances that are contained by this IPropertyAggregator instance.
Constructor Detail

DefaultPropertyAggregator

protected DefaultPropertyAggregator()
Creates a new DefaultPropertyAggregator instance.
Method Detail

isWriteable

public boolean isWriteable()
Returns whether this IPropertySource instance is a writeable IPropertySource instance.

This implementation checks to see if any of the contained IPropertySource instances are writeable and returns true, otherwise, returns false.

Specified by:
isWriteable in interface IPropertySource
Returns:
true if this IPropertySource instance is writeable, false if not.

setWriteable

public void setWriteable(boolean aWriteable)
Sets whether this IPropertySource instance is a writeable IPropertySource instance.
Specified by:
setWriteable in interface IPropertySource
Parameters:
aWriteable - if true, then this IPropertySource instance is writeable, false otherwise.

save

public void save()
          throws java.lang.UnsupportedOperationException,
                 java.lang.Exception
Saves all modified properties to the properties source represented by this IPropertySource instance.
Specified by:
save in interface IPropertySource
Throws:
java.lang.UnsupportedOperationException - if the operation is unsupported.
java.lang.Exception - if an error occurs during the save process.

load

public void load()
          throws java.lang.Exception
Loads properties from the properties source represented by this IPropertySource instance.
Specified by:
load in interface IPropertySource
Throws:
java.lang.Exception - if any error occurs during the load process.

addPropertySource

public void addPropertySource(int aRank,
                              IPropertySource aPropertySource)
Adds the specified IPropertySource instance to this IPropertyAggregator instance at the specified ranking, replacing the IPropertySource instance that was in that rank, if any.
Specified by:
addPropertySource in interface IPropertyAggregator
Parameters:
aRank - the rank the specifed IPropertySource instance should be added.
aPropertySource - the IPropertySource instance to be added.

addPropertySource

public void addPropertySource(IPropertySource aPropertySource)
Adds the specified IPropertySource instance to this IPropertyAggregator instance at the lowest ranking (at the end of the aggregate list).
Specified by:
addPropertySource in interface IPropertyAggregator
Parameters:
aPropertySource - the IPropertySource instance to be added.

getPropertySource

public IPropertySource getPropertySource(java.lang.Object aID)
Returns the specified IPropertySource instance from this IPropertyAgregator instance with the specified identifier.
Specified by:
getPropertySource in interface IPropertyAggregator
Parameters:
aID - the identifier of the IPropertySource instance to return.
Returns:
the IPropertySource instance with the specified identifier.

getPropertySource

public IPropertySource getPropertySource(int aRank)
Returns the specified IPropertySource instance from this IPropertyAgregator instance at the specified ranking.
Specified by:
getPropertySource in interface IPropertyAggregator
Parameters:
aRank - the rank for which to return an IPropertySource instance
Returns:
the IPropertySource instance with the specified identifier.

getPropertySources

public java.util.Iterator getPropertySources()
Returns the IPropertySource instances from this IPropertyAgregator instance.
Specified by:
getPropertySources in interface IPropertyAggregator
Returns:
an Iterator over the IPropertySource instanced contained by this IPropertyAgregator instance.

removePropertySource

public void removePropertySource(IPropertySource aPropertySource)
Removes the specified IPropertySource instance from this IPropertyAgregator instance.
Specified by:
removePropertySource in interface IPropertyAggregator
Parameters:
aPropertySource - the IPropertySource instance to remove.

getValue

public java.lang.Object getValue()
Returns the value of this INode instance

This implementation throws an UnsupportedOperationException.

Specified by:
getValue in interface INode
Returns:
the value of this INode instance.
See Also:
setValue(Object)

setValue

public void setValue(java.lang.Object aValue)
Sets the value for this INode instance.

Fires an INodeResources.VALUE_PROPERTY property change event.

This implementation throws an UnsupportedOperationException.

Specified by:
setValue in interface INode
Parameters:
aValue - the value for this INode instance.
See Also:
getValue()

size

public int size()
Returns the number of children in this INode instance. If the INode contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

This implementation throws an UnsupportedOperationException.

Specified by:
size in interface INode
Returns:
the number of children in this INode instance.
See Also:
isEmpty()

isEmpty

public boolean isEmpty()
Indicates whether this INode instance has no children.

This implementation throws an UnsupportedOperationException.

Specified by:
isEmpty in interface INode
Returns:
true if this INode instance contains no children.
See Also:
size()

clear

public void clear()
Removes the children from this INode instance.

Fires an INodeResources.CLEAR_PROPERTY property change event only if there were children that were cleared from this INode instance.

This implementation throws an UnsupportedOperationException.

Specified by:
clear in interface INode

containsID

public boolean containsID(java.lang.Object aId)
Indicates whether this INode instance contains the specified identifer as a child of this INode instance.

This implementation will return true if any of the contained IPropertySource instances contains the specified identifier.

Specified by:
containsID in interface INode
Parameters:
aId - the identifer of the child INode instance for which to search.
Returns:
true if this INode instance contains the specified child.

getList

public java.util.List getList(java.lang.Object aId)
Returns the List of INode child instances with the specified identifer. The list is in insertion order: the first INode child instance added to this INode instance is the first INode child instance in the returned List instance. Returns null if this INode instance does not contain any INode child instances with the specified identifier.

The returned List instance is immutable. That is, you cannot alter the position or size of the returned List instance.

This implementation will return the highest ranked, non-null result from the contained IPropertySource instances.

Specified by:
getList in interface INode
Parameters:
aId - identifer whose associated INode child instances are returned.
Returns:
the List of INode child instances with the specified identifer, or null if this INode contains no children with the specified identifier.
See Also:
get(Object), get(int), remove(INode), add(INode)

get

public INode get(java.lang.Object aId)
Returns the first INode child instance that contains specified identifer. Returns null if this INode instance does not contain children with specified identifer.

This implementation will return the highest ranked, non-null result from the contained IPropertySource instances.

Specified by:
get in interface INode
Parameters:
aId - identifer whose associated INode child instances are returned.
Returns:
the first INode child instances with the specified identifer, or null if this INode instance contains no children for this identifer.
See Also:
get(int), remove(INode), add(INode)

get

public INode get(int aIndex)
Returns the INode child instance at the specified index. Indexes are 0 based.

This implementation will return the highest ranked, non-null result from the contained IPropertySource instances.

Specified by:
get in interface INode
Parameters:
aIndex - the index of the INode child instance to return.
Returns:
the INode child instance at the specified index.
Throws:
ArrayIndexOutOfBoundsException - if there is no value at the specified index. Said differently, this INode instance's size is less than the specified index.
See Also:
get(Object), remove(INode), add(INode)

remove

public void remove(INode aNode)
Removes the INode child instance for the specified identifer from this INode instance if present.

Fires an INodeResources.REMOVE_PROPERTY property change event.

This implementation throws an UnsupportedOperationException.

Specified by:
remove in interface INode
Parameters:
aNode - INode child instance to be removed from this INode instance.
See Also:
get(Object), get(int), add(INode)

add

public void add(INode aNode)
Appends the specified INode child instance to the end of this INode instances child collection. This method automatically adds this INode instance as a parent of the specified child INode instance.

This implementation iterates through the contained IPropertySource instances and adds the specified INode instance to the first writable IPropertySource instance.

Fires an INodeResources.ADD_PROPERTY property change event. This implementation throws an UnsupportedOperationException.

Specified by:
add in interface INode
Parameters:
aNode - INode child instance to be appended to this INode instance.
See Also:
add(INode, boolean), get(Object), get(int), remove(INode)

add

public void add(INode aNode,
                boolean bAddParent)
Appends the specified INode child instance to the end of this INode instance's child collection. Per the value of the boolean parameter, will add this INode instance as a parent of the specified child INode instance.

This implementation iterates through the contained IPropertySource instances and adds the specified INode instance to the first writable IPropertySource instance.

Fires an INodeResources.ADD_PROPERTY property change event. This implementation throws an UnsupportedOperationException.

Specified by:
add in interface INode
Parameters:
aNode - INode child instance to be appended to this INode instance.
bAddParent - if true, will add this INode instance as the parent of the specified child INode instance, if false, does not add parent link to the child.
See Also:
add(INode), get(Object), get(int), remove(INode)

addParent

public void addParent(INode aParent)
Sets the parent INode instance for this INode instance.

This method is semantically dangerous to client developers. It could put the graph structure that this INode instance belongs to into an inconsistant state. Use this method with caution.

Fires an INodeResources.PARENT_PROPERTY property change event.

This implementation throws an UnsupportedOperationException.

Specified by:
addParent in interface INode
Parameters:
aParent - the INode parent instance to be set.
See Also:
removeParent(INode), getParents()

getParent

public INode getParent(int aIndex)
Returns the INode parent instance at the specified index.

This implementation throws an UnsupportedOperationException.

Parameters:
aIndex - the index of the INode parent instance to return.
Returns:
the INode parent instance at the specified index.
Throws:
ArrayIndexOutOfBoundsException - if no parent is at the specified index.
See Also:
removeParent(INode), getParents(), addParent(INode)

getParents

public java.util.Iterator getParents()
Returns an Iterator over the INode parent instances of this INode instance.

This implementation throws an UnsupportedOperationException.

Specified by:
getParents in interface INode
Returns:
the parent INode instances for this INode instance.
See Also:
removeParent(INode), addParent(INode)

removeParent

public void removeParent(INode aParent)
Removes the specified parent INode instance from this INode instance.

This implementation throws an UnsupportedOperationException.

Specified by:
removeParent in interface INode
Parameters:
aParent - the Parent to remove from this INode instance.
See Also:
addParent(INode), getParents()

iterator

public java.util.Iterator iterator()
Returns an Iterator over this INode instance's children. This is a shallow operation, iterating through this INode instance's children and no further child generations. If you wish deep iterators, see the net.sourceforge.esw.graph.decorators package.

This implementation throws an UnsupportedOperationException.

Specified by:
iterator in interface INode
Returns:
an iterator over the INode child instances of this INode instance.

acceptVisitor

public void acceptVisitor(IGraphVisitor aVisitor)
Requests that this INode instance accept the specified IGraphVisitor instance and that visiting of this INode struture begin. This is a shallow operation, visiting this INode instance's children and no further child generations. If you wish deep visits, see the net.sourceforge.esw.graph.decorators package.

This implementation throws an UnsupportedOperationException.

Specified by:
acceptVisitor in interface INode
Parameters:
aVisitor - the IGraphVisitor instance to visit the children of this INode instance.

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener aListener)
Adds a PropertyChangeListener to this ISupportObject instance.

This implementation throws an UnsupportedOperationException.

Specified by:
addPropertyChangeListener in interface ISupportObject
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.

This implementation throws an UnsupportedOperationException.

Specified by:
addPropertyChangeListener in interface ISupportObject
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.

This implementation throws an UnsupportedOperationException.

Specified by:
addVetoableChangeListener in interface ISupportObject
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.

This implementation throws an UnsupportedOperationException.

Specified by:
addVetoableChangeListener in interface ISupportObject
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.

This implementation throws an UnsupportedOperationException.

Specified by:
removePropertyChangeListener in interface ISupportObject
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.

This implementation throws an UnsupportedOperationException.

Specified by:
removePropertyChangeListener in interface ISupportObject
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.

This implementation throws an UnsupportedOperationException.

Specified by:
removeVetoableChangeListener in interface ISupportObject
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.

This implementation throws an UnsupportedOperationException.

Specified by:
removeVetoableChangeListener in interface ISupportObject
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.

This implementation throws an UnsupportedOperationException.

Specified by:
setProperty in interface ISupportObject
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.

This implementation throws an UnsupportedOperationException.

Specified by:
getProperty in interface ISupportObject
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.

This implementation throws an UnsupportedOperationException.

Specified by:
removeProperty in interface ISupportObject
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.

This implementation throws an UnsupportedOperationException.

Specified by:
propertyKeys in interface ISupportObject
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.

This implementation throws an UnsupportedOperationException.

Specified by:
getPropertySize in interface ISupportObject
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.

This implementation throws an UnsupportedOperationException.

Specified by:
setID in interface ISupportObject
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.

This implementation throws an UnsupportedOperationException.

Specified by:
getID in interface ISupportObject
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.

This implementation throws an UnsupportedOperationException.

Specified by:
firePropertyChange in interface ISupportObject
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.

This implementation throws an UnsupportedOperationException.

Specified by:
firePropertyChange in interface ISupportObject
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.

This implementation throws an UnsupportedOperationException.

Specified by:
fireVetoableChange in interface ISupportObject
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.

This implementation throws an UnsupportedOperationException.

Specified by:
fireVetoableChange in interface ISupportObject
Parameters:
aEvent - the event to fire.

clone

public java.lang.Object clone()
Creates and returns a clone of the implementing Object. The implementor defines whether the cloning is deep or shallow.

This implementation throws an UnsupportedOperationException.

Specified by:
clone in interface ICloneable
Overrides:
clone in class java.lang.Object
Returns:
a copy of the implementing Object.

findOutIfWriteable

protected void findOutIfWriteable()
Checks to see if any of the IPropertySource instances are writeable. If so, sets the writable flag to true.

getMethod

protected java.lang.Object getMethod(java.lang.reflect.Method aMethod,
                                     java.lang.Object[] args)
Iterates through the IPropertySource instances and finds the first IPropertySource instance that returns a non-null result.
Returns:
the value from the first IPropertySource instance that returns a non-null result, or null.


Copyright 2002 Free Software Foundation. All Rights Reserved.