com.sun.jimi.util
Interface PropertyOwner

All Known Subinterfaces:
OptionsObject
All Known Implementing Classes:
PropertyOwnerBase

public abstract interface PropertyOwner

Useful interface to check for consistancy of implementation of a generalised Property holding facility on any given class.


Field Summary
static java.lang.String ANY_VALUE_STRING
           
static java.lang.Boolean[] BOOLEAN_ARRAY
          Keeps memory use down for boolean options
 
Method Summary
 void clearProperties()
          Clear all values and keys
 java.lang.Object getPossibleValuesForProperty(java.lang.String name)
          What possible values may this property take on.
 java.lang.Object getProperty(java.lang.String key)
           
 java.lang.String getPropertyDescription(java.lang.String name)
          A brief description of the purpose of this property.
 java.util.Enumeration getPropertyNames()
          The names of the properties that may be set.
 void setProperty(java.lang.String key, java.lang.Object val)
          Matching getProperty() method for the setProperty() method.
 

Field Detail

ANY_VALUE_STRING

public static final java.lang.String ANY_VALUE_STRING

BOOLEAN_ARRAY

public static final java.lang.Boolean[] BOOLEAN_ARRAY
Keeps memory use down for boolean options
Method Detail

getProperty

public java.lang.Object getProperty(java.lang.String key)
Parameters:
key - the id of the property to set a value for
val - the value to set the property to
Returns:
the previous value of the property being set

setProperty

public void setProperty(java.lang.String key,
                        java.lang.Object val)
                 throws InvalidOptionException
Matching getProperty() method for the setProperty() method.
Parameters:
key - which property to retrieve the value for
Returns:
the value in this property list with the specified key value
Throws:
InvalidOptionException - thrown when an Encoder or Decoder finds any problems with the key value pair that is set.

getPossibleValuesForProperty

public java.lang.Object getPossibleValuesForProperty(java.lang.String name)
                                              throws InvalidOptionException
What possible values may this property take on. A null return value indicates any value. A java.lang.String matching ANY_VALUE_STRING indicates that the value may be any string. Otherwise it will return an array of valid values.
Parameters:
key - Property to get possible values for
Returns:
Either
  • null
  • ANY_VALUE_STRING
  • Object[]The possible values for this property. (Usually a String[])
Throws:
InvalidOptionException - thrown if the parameter name is not a valid option property for this implementation of PropertyOwner.
See Also:
ANY_VALUE_STRING, setProperty

getPropertyDescription

public java.lang.String getPropertyDescription(java.lang.String name)
                                        throws InvalidOptionException
A brief description of the purpose of this property.
Parameters:
name - Property to be described
Returns:
The description
Throws:
InvalidOptionException - thrown if the parameter name is not a valid option property for this implementation of PropertyOwner.
See Also:
getPossibleValuesForProperty

getPropertyNames

public java.util.Enumeration getPropertyNames()
The names of the properties that may be set.
See Also:
getPossibleValuesForProperty

clearProperties

public void clearProperties()
Clear all values and keys