uk.co.jcp.util.properties
Interface PropertySection

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
JCPProperties

public interface PropertySection
extends java.io.Serializable


Method Summary
 byte[] getBlobProperty(java.lang.String key)
          Retrieve a property as a BLOB (byte[])
 byte[] getBlobProperty(java.lang.String key, byte[] defaultValue)
          Retrieve a property as a BLOB ( byte[] )
 boolean getBooleanProperty(java.lang.String key)
          Retrieve a property as a boolean
 boolean getBooleanProperty(java.lang.String key, boolean defaultValue)
          Retrieve a property as a boolean
 java.util.Date getDateProperty(java.lang.String key)
          Retrieve a property as a Date
 java.util.Date getDateProperty(java.lang.String key, java.util.Date defaultValue)
          Retrieve a property as a Date
 java.util.Date getDateProperty(java.lang.String key, java.lang.String dateFormat)
          Retrieve a property as a Date
 java.util.Date getDateProperty(java.lang.String key, java.lang.String dateFormat, java.util.Date defaultValue)
          Retrieve a property as a Date
 double getDoubleProperty(java.lang.String key)
          Retrieve a property as a double
 double getDoubleProperty(java.lang.String key, double defaultValue)
          Retrieve a property as a double
 java.util.Enumeration getEnumeratedProperty(java.lang.String key)
          Retrieve a set of properties under a common name, as an Enumeration of Strings
 float getFloatProperty(java.lang.String key)
          Retrieve a property as a float
 float getFloatProperty(java.lang.String key, float defaultValue)
          Retrieve a property as a float
 int getIntProperty(java.lang.String key)
          Retrieve a property as an int
 int getIntProperty(java.lang.String key, int defaultValue)
          Retrieve a property as an int
 java.util.Enumeration getKeys()
          Get the keys set in this properties object
 long getLongProperty(java.lang.String key)
          Retrieve a property as a long
 long getLongProperty(java.lang.String key, long defaultValue)
          Retrieve a property as a long
 java.lang.Object getObjectProperty(java.lang.String key)
          Retrieve a property as an Object
 java.lang.Object getObjectProperty(java.lang.String key, java.lang.Object defaultValue)
          Retrieve a property as an Object
 java.lang.String getSectionName()
          returns the identifier for this section
 java.lang.String getStringProperty(java.lang.String key)
          Retrieve a property as a String
 java.lang.String getStringProperty(java.lang.String key, java.lang.String defaultValue)
          Retrieve a property as a String
 void setBooleanProperty(java.lang.String key, boolean value)
          Set a property as a boolean
 void setDateProperty(java.lang.String key, java.util.Date value)
          Set a property as a boolean
 void setDateProperty(java.lang.String key, java.util.Date value, java.lang.String dateFormat)
          Set a property as a boolean
 void setDoubleProperty(java.lang.String key, double value)
          Set a property as a double
 void setEnumeratedProperty(java.lang.String key, java.util.Enumeration values)
          Set a set of properties under a common name, as an Enumeration of Strings
 void setFloatProperty(java.lang.String key, float value)
          Set a property as a float
 void setIntProperty(java.lang.String key, int value)
          Set a property as an integer
 void setLongProperty(java.lang.String key, long value)
          Set a property as a long
 void setObjectProperty(java.lang.String key, java.lang.Object value)
          Set a property as an Object
 void setStringProperty(java.lang.String key, java.lang.String value)
          Set a property as a String
 

Method Detail

getSectionName

public java.lang.String getSectionName()
returns the identifier for this section

getBlobProperty

public byte[] getBlobProperty(java.lang.String key)
                       throws MalformedPropertyException,
                              PropertyNotFoundException
Retrieve a property as a BLOB (byte[])
Parameters:
key - the key to use
Returns:
The property
Throws:
MalformedPropertyException - could not be parsed to the correct format
PropertyNotFoundException - if the property does not exist

getBlobProperty

public byte[] getBlobProperty(java.lang.String key,
                              byte[] defaultValue)
                       throws MalformedPropertyException
Retrieve a property as a BLOB ( byte[] )
Parameters:
key - the key to use
defaultValue - the value to use if the entry cannot be found
Returns:
The property or the default value of the property is not present
Throws:
MalformedPropertyException - if the value could not be parsed correctly

getBooleanProperty

public boolean getBooleanProperty(java.lang.String key)
                           throws MalformedPropertyException,
                                  PropertyNotFoundException
Retrieve a property as a boolean
Parameters:
key - the key to use
Returns:
The property
Throws:
MalformedPropertyException - could not be parsed to the correct format
PropertyNotFoundException - if the property does not exist

getBooleanProperty

public boolean getBooleanProperty(java.lang.String key,
                                  boolean defaultValue)
                           throws MalformedPropertyException
Retrieve a property as a boolean
Parameters:
key - the key to use
defaultValue - the value to use if the entry cannot be found
Returns:
The property or the default value of the property is not present
Throws:
MalformedPropertyException - if the value could not be parsed correctly

getDateProperty

public java.util.Date getDateProperty(java.lang.String key)
                               throws MalformedPropertyException,
                                      PropertyNotFoundException
Retrieve a property as a Date
Parameters:
key - the key to use
Returns:
The property
Throws:
MalformedPropertyException - could not be parsed to the correct format
PropertyNotFoundException - if the property does not exist

getDateProperty

public java.util.Date getDateProperty(java.lang.String key,
                                      java.lang.String dateFormat)
                               throws MalformedPropertyException,
                                      PropertyNotFoundException
Retrieve a property as a Date
Parameters:
key - the key to use
dateFormat - the format string for the date
Returns:
The property
Throws:
MalformedPropertyException - could not be parsed to the correct format
PropertyNotFoundException - if the property does not exist
See Also:
for details on the composition of the format string

getDateProperty

public java.util.Date getDateProperty(java.lang.String key,
                                      java.lang.String dateFormat,
                                      java.util.Date defaultValue)
                               throws MalformedPropertyException
Retrieve a property as a Date
Parameters:
key - the key to use
defaultValue - the value to use if the entry cannot be found
dateFormat - the format string for the date
Returns:
The property or the default value of the property is not present
Throws:
MalformedPropertyException - if the value could not be parsed correctly
See Also:
for details on the composition of the format string

getDateProperty

public java.util.Date getDateProperty(java.lang.String key,
                                      java.util.Date defaultValue)
                               throws MalformedPropertyException
Retrieve a property as a Date
Parameters:
key - the key to use
defaultValue - the value to use if the entry cannot be found
Returns:
The property or the default value of the property is not present
Throws:
MalformedPropertyException - if the value could not be parsed correctly

getDoubleProperty

public double getDoubleProperty(java.lang.String key)
                         throws MalformedPropertyException,
                                PropertyNotFoundException
Retrieve a property as a double
Parameters:
key - the key to use
Returns:
The property
Throws:
MalformedPropertyException - could not be parsed to the correct format
PropertyNotFoundException - if the property does not exist

getDoubleProperty

public double getDoubleProperty(java.lang.String key,
                                double defaultValue)
                         throws MalformedPropertyException
Retrieve a property as a double
Parameters:
key - the key to use
defaultValue - the value to use if the entry cannot be found
Returns:
The property or the default value of the property is not present
Throws:
MalformedPropertyException - if the value could not be parsed correctly

getEnumeratedProperty

public java.util.Enumeration getEnumeratedProperty(java.lang.String key)
                                            throws PropertyNotFoundException
Retrieve a set of properties under a common name, as an Enumeration of Strings
Parameters:
the - key to use
Returns:
an Enumeration of properties, as Strings.
Throws:
PropertyNotFoundException - if the property does not exist

getFloatProperty

public float getFloatProperty(java.lang.String key)
                       throws MalformedPropertyException,
                              PropertyNotFoundException
Retrieve a property as a float
Parameters:
key - the key to use
Returns:
The property
Throws:
MalformedPropertyException - could not be parsed to the correct format
PropertyNotFoundException - if the property does not exist

getFloatProperty

public float getFloatProperty(java.lang.String key,
                              float defaultValue)
                       throws MalformedPropertyException
Retrieve a property as a float
Parameters:
key - the key to use
defaultValue - the value to use if the entry cannot be found
Returns:
The property or the default value of the property is not present
Throws:
MalformedPropertyException - if the value could not be parsed correctly

getIntProperty

public int getIntProperty(java.lang.String key)
                   throws MalformedPropertyException,
                          PropertyNotFoundException
Retrieve a property as an int
Parameters:
key - the key to use
Returns:
The property
Throws:
MalformedPropertyException - could not be parsed to the correct format
PropertyNotFoundException - if the property does not exist

getIntProperty

public int getIntProperty(java.lang.String key,
                          int defaultValue)
                   throws MalformedPropertyException
Retrieve a property as an int
Parameters:
key - the key to use
defaultValue - the value to use if the entry cannot be found
Returns:
The property or the default value of the property is not present
Throws:
MalformedPropertyException - if the value could not be parsed correctly

getKeys

public java.util.Enumeration getKeys()
Get the keys set in this properties object
Returns:
an enumeration of Strings representing the keys

getLongProperty

public long getLongProperty(java.lang.String key)
                     throws MalformedPropertyException,
                            PropertyNotFoundException
Retrieve a property as a long
Parameters:
key - the key to use
Returns:
The property
Throws:
MalformedPropertyException - could not be parsed to the correct format
PropertyNotFoundException - if the property does not exist

getLongProperty

public long getLongProperty(java.lang.String key,
                            long defaultValue)
                     throws MalformedPropertyException
Retrieve a property as a long
Parameters:
key - the key to use
defaultValue - the value to use if the entry cannot be found
Returns:
The property or the default value of the property is not present
Throws:
MalformedPropertyException - if the value could not be parsed correctly

getObjectProperty

public java.lang.Object getObjectProperty(java.lang.String key)
                                   throws PropertyNotFoundException
Retrieve a property as an Object
Parameters:
key - the key to use
Returns:
The property
Throws:
PropertyNotFoundException - if the property does not exist

getObjectProperty

public java.lang.Object getObjectProperty(java.lang.String key,
                                          java.lang.Object defaultValue)
Retrieve a property as an Object
Parameters:
key - the key to use
defaultValue - the value to use if the entry cannot be found
Returns:
The property

getStringProperty

public java.lang.String getStringProperty(java.lang.String key)
                                   throws PropertyNotFoundException
Retrieve a property as a String
Parameters:
key - the key to use
Returns:
The property
Throws:
PropertyNotFoundException - if the property does not exist

getStringProperty

public java.lang.String getStringProperty(java.lang.String key,
                                          java.lang.String defaultValue)
Retrieve a property as a String
Parameters:
key - the key to use
defaultValue - the value to use if the entry cannot be found
Returns:
The property or the default value of the property is not present

setBooleanProperty

public void setBooleanProperty(java.lang.String key,
                               boolean value)
                        throws PropertyException
Set a property as a boolean
Parameters:
key - the key to use for this property
value - the value to store

setDateProperty

public void setDateProperty(java.lang.String key,
                            java.util.Date value)
                     throws PropertyException
Set a property as a boolean
Parameters:
key - the key to use for this property
value - the value to store

setDateProperty

public void setDateProperty(java.lang.String key,
                            java.util.Date value,
                            java.lang.String dateFormat)
                     throws PropertyException
Set a property as a boolean
Parameters:
key - the key to use for this property
value - the value to store
dateFormat - the format string for the date
See Also:
for details on the composition of the format string

setDoubleProperty

public void setDoubleProperty(java.lang.String key,
                              double value)
                       throws PropertyException
Set a property as a double
Parameters:
key - the key to use for this property
value - the value to store

setEnumeratedProperty

public void setEnumeratedProperty(java.lang.String key,
                                  java.util.Enumeration values)
                           throws PropertyException
Set a set of properties under a common name, as an Enumeration of Strings
Parameters:
the - key to use
Returns:
an Enumeration of properties, as Strings. If there are no matching properties, an empty Enumeration will be returned.

setFloatProperty

public void setFloatProperty(java.lang.String key,
                             float value)
                      throws PropertyException
Set a property as a float
Parameters:
key - the key to use for this property
value - the value to store

setIntProperty

public void setIntProperty(java.lang.String key,
                           int value)
                    throws PropertyException
Set a property as an integer
Parameters:
key - the key to use for this property
value - the value to store

setLongProperty

public void setLongProperty(java.lang.String key,
                            long value)
                     throws PropertyException
Set a property as a long
Parameters:
key - the key to use for this property
value - the value to store

setObjectProperty

public void setObjectProperty(java.lang.String key,
                              java.lang.Object value)
                       throws PropertyException
Set a property as an Object
Parameters:
key - the key to use for this property
value - the value to store

setStringProperty

public void setStringProperty(java.lang.String key,
                              java.lang.String value)
                       throws PropertyException
Set a property as a String
Parameters:
key - the key to use for this property
value - the value to store