edu.usc.cse.desi.properties
Interface IObjectWithProperties

All Known Implementing Classes:
AbstractDataModel, PropertyHolder

public interface IObjectWithProperties

The public interface implemented by all objects that have properties. It allows for the getting and setting of the various properties held by that object.

Author:
nbeckman Started on Jul 19, 2004

Method Summary
 java.util.Collection getProperties()
          This method returns a Collection of all the Propery objects for the given implementor.
 java.lang.String getPropertyDisplayName(java.lang.String prop_name)
          Properties, in addition to having values also have display names.
 java.lang.Object getPropertyValue(java.lang.String prop_name)
          This method should gets the given property.
 boolean hasProperty(java.lang.String prop_name)
          Checks to see if the object has the given property.
 void setPropertyValue(java.lang.String prop_name, java.lang.Object value)
          This method will set the given property with the given value.
 

Method Detail

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.String prop_name)
                                  throws PropertyNotFoundException
This method should gets the given property. If the property does not exist, a PropertyNotFoundException is thrown.

Parameters:
prop_name - The name of the property to get.
Returns:
Object - The value of the given property.
Throws:
PropertyNotFoundException - Thrown if the given property does not exist for this type.

getPropertyDisplayName

public java.lang.String getPropertyDisplayName(java.lang.String prop_name)
                                        throws PropertyNotFoundException
Properties, in addition to having values also have display names. This method will return the display name for the given property.

Parameters:
prop_name -
Returns:
Throws:
PropertyNotFoundException

setPropertyValue

public void setPropertyValue(java.lang.String prop_name,
                             java.lang.Object value)
                      throws PropertyNotFoundException,
                             java.lang.ClassCastException
This method will set the given property with the given value. If the property does not exist, a PropertyNotFoundException is thrown. If the type of the value is not compatable with the type of the property, it throws a ClassCastException.

Parameters:
prop_name - String - The name of the proerty to be set.
value - Object - The value to set the property to.
Throws:
PropertyNotFoundException - Thrown if this object doesn't have the given property.
java.lang.ClassCastException - Thrown if there is a mismatch between the given value type and the type of the property.

hasProperty

public boolean hasProperty(java.lang.String prop_name)
Checks to see if the object has the given property.

Parameters:
prop_name - String - The name of the property.
Returns:
true - This object has the given property. false - This object doesn't have the given property.

getProperties

public java.util.Collection getProperties()
This method returns a Collection of all the Propery objects for the given implementor.

Returns:
Collection - A Collection of Property Objects.