org.sape.carbon.core.config.format.jdom
Class JDOMPropertyConfiguration

java.lang.Object
  |
  +--org.sape.carbon.core.config.format.jdom.JDOMPropertyConfiguration
All Implemented Interfaces:
Configuration, PropertyConfiguration

public class JDOMPropertyConfiguration
extends Object
implements PropertyConfiguration

This is an implementation of the string based attribute lookup PropertyConfiguration.

Copyright 2001 Sapient

Since:
carbon 1.0
Version:
$Revision: 1.20 $($Author: dvoet $ / $Date: 2003/05/05 21:21:17 $)
Author:
Greg Hinkle, February 2002

Field Summary
private static String COMMA_DELIMITER
          Comma delimiter: ,
private  org.jdom.Document document
          The JDOM document that holds the root element.
private  PropertyConfiguration extendedConfig
          Holds a reference to the configuration this extends.
private  String name
          Name of the configuration.
private static String NAME_DELIMITER
          Name delimiter: space
private  Map propertyCache
          cache of text values contained in document keyed by property name
private  org.jdom.Element rootElement
          Holds the root element of the JDOM document.
private  ConfigurationTypeService typeService
          Holds a reference to the type config service.
private static String WHITE_SPACE_INPUT_DELIMITERS
          Deletermins for whitespace input.
private static String WHITE_SPACE_OUTPUT_DELIMITER
          Whitespace output delimiter.
private  boolean writable
          True if this object may be altered, false if it should throw exceptions when attempts are made to alter it.
 
Constructor Summary
JDOMPropertyConfiguration()
          Creates a new empty configruation that extends nothing.
JDOMPropertyConfiguration(org.jdom.Document document)
          Constructs a JDOMConfigurationProxy for the specified class type.
JDOMPropertyConfiguration(org.jdom.Document document, PropertyConfiguration extendedConfig)
          Constructs a new configruation that extends another configuration.
JDOMPropertyConfiguration(PropertyConfiguration extendedConfig)
          Constructs a new blank configruation that extends another configuration.
 
Method Summary
private  String arrayToDelimitedString(String[] values, String delimiter)
          Serializes an array of Strings into a single String with values delimited by delimiter
 Object clone()
           This method makes a deep-copy of the underlying data structure for this configuration
private  String[] delimitedStringToArray(String delimitedValues, String delimiters)
          Converts a String with values delimted by delimiters to an array of Strings.
 boolean getBooleanProperty(String propertyName)
          Retrieves a configured boolean values
 boolean getBooleanProperty(String propertyName, boolean defaultValue)
          Retrieves a configured boolean values
 byte getByteProperty(String propertyName)
          Retrieves a configured byte property.
 byte getByteProperty(String propertyName, byte defaultValue)
          Retrieves a configured byte property.
 Class getClassProperty(String propertyName)
          Retrieves a configured class object
 Class getClassProperty(String propertyName, Class defaultValue)
          Retrieves a configured Class values
 Class getConfigurationInterface()
          Returns the interface of the configuration.
 String getConfigurationName()
          Returns the name of this configuration in the backing store, but may be null if the Configuration has not yet been saved to the backing store.
 String[] getCSVProperty(String propertyName)
          Retrieves an array of string values that are retrieved from the configuration document at the supplied key.
 org.jdom.Document getDataStructure()
          Gets the document containing the root element.
 Date getDateProperty(String propertyName)
          Retrieves a configured class object
 Date getDateProperty(String propertyName, Date defaultValue)
          Retrieves a configured Class values
 double getDoubleProperty(String propertyName)
          Retrieves a configured double value
 double getDoubleProperty(String propertyName, double defaultValue)
          Retrieves a configured double values
 float getFloatProperty(String propertyName)
          Retrieves a configured float value.
 float getFloatProperty(String propertyName, float defaultValue)
          Retrieves a configured float values
 int getIntProperty(String propertyName)
          Retrieves a configured int value
 int getIntProperty(String propertyName, int defaultValue)
          Retrieves a configured int values
 long getLongProperty(String propertyName)
          Retrieves a configured long property.
 long getLongProperty(String propertyName, long defaultValue)
          Retrieves a configured long values
 String getProperty(String propertyName)
          Retrieves a string property configuration
private  Object getProperty(String propertyName, Object defaultValue, Class type)
          Centralized method for property lookup.
 String getProperty(String propertyName, String defaultValue)
          Retrieves a string property configuration or returns the supplied default if none is found.
 org.jdom.Element getRootElement()
          Gets the root element of the configuration.
 short getShortProperty(String propertyName)
          Retrieves a configured short value
 short getShortProperty(String propertyName, short defaultValue)
          Retrieves a configured short values
 String[] getWSVProperty(String propertyName)
          Retrieves an array of string values that are retrieved from the configuration document at the supplied key.
 boolean isConfigurationWritable()
          Is this configuration document writable or is it read-only.
private  void preloadProperyCache(org.jdom.Element parentElement, String parentElementName)
          Loads up the property cache with all the values.
 void setBooleanProperty(String propertyName, boolean value)
          Sets the property named by propertyName to the value specified by value as a boolean
 void setByteProperty(String propertyName, byte value)
          Sets the property named by propertyName to the value specified by value as a byte
 void setClassProperty(String propertyName, Class value)
          Sets the property named by propertyName to the value specified by value as a Class
 void setConfigurationName(String name)
          Alters the name of this configuration document
 void setConfigurationReadOnly()
          Sets whether this configuration may be altered.
 void setCSVProperty(String propertyName, String[] values)
          Sets the property named by propertyName to the value specified by value as a comma separated list of strings
 void setDateProperty(String propertyName, Date value)
          Sets the property named by propertyName to the value specified by value as a Class
 void setDoubleProperty(String propertyName, double value)
          Sets the property named by propertyName to the value specified by value as a double
 void setFloatProperty(String propertyName, float value)
          Sets the property named by propertyName to the value specified by value as a float
 void setIntProperty(String propertyName, int value)
          Sets the property named by propertyName to the value specified by value as a int
 void setLongProperty(String propertyName, long value)
          Sets the property named by propertyName to the value specified by value as a long
 void setProperty(String propertyName, String value)
          Sets the property named by propertyName to the value specified by value as a String
 void setShortProperty(String propertyName, short value)
          Sets the property named by propertyName to the value specified by value as a short
 void setWSVProperty(String propertyName, String[] values)
          Sets the property named by propertyName to the value specified by value as a white-space separated list of strings
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME_DELIMITER

private static final String NAME_DELIMITER
Name delimiter: space

See Also:
Constant Field Values

COMMA_DELIMITER

private static final String COMMA_DELIMITER
Comma delimiter: ,

See Also:
Constant Field Values

WHITE_SPACE_OUTPUT_DELIMITER

private static final String WHITE_SPACE_OUTPUT_DELIMITER
Whitespace output delimiter. Space.

See Also:
Constant Field Values

WHITE_SPACE_INPUT_DELIMITERS

private static final String WHITE_SPACE_INPUT_DELIMITERS
Deletermins for whitespace input. Includes space, tab and newlline.

See Also:
Constant Field Values

name

private String name
Name of the configuration.


document

private org.jdom.Document document
The JDOM document that holds the root element.


rootElement

private org.jdom.Element rootElement
Holds the root element of the JDOM document.


extendedConfig

private PropertyConfiguration extendedConfig
Holds a reference to the configuration this extends.


typeService

private ConfigurationTypeService typeService
Holds a reference to the type config service.


propertyCache

private Map propertyCache
cache of text values contained in document keyed by property name


writable

private boolean writable
True if this object may be altered, false if it should throw exceptions when attempts are made to alter it.

Constructor Detail

JDOMPropertyConfiguration

public JDOMPropertyConfiguration(org.jdom.Document document)
Constructs a JDOMConfigurationProxy for the specified class type. This class only supports subclasses of the Configuration object. The supplied document is used as the backing store for this configuration object's data.

Parameters:
document - The JDOM Document object representing a configurations data

JDOMPropertyConfiguration

public JDOMPropertyConfiguration()
Creates a new empty configruation that extends nothing.


JDOMPropertyConfiguration

public JDOMPropertyConfiguration(org.jdom.Document document,
                                 PropertyConfiguration extendedConfig)
Constructs a new configruation that extends another configuration.

Parameters:
document - configuration document
extendedConfig - the configuration being extended.

JDOMPropertyConfiguration

public JDOMPropertyConfiguration(PropertyConfiguration extendedConfig)
Constructs a new blank configruation that extends another configuration.

Parameters:
extendedConfig - the configuration being extended.
Method Detail

getConfigurationInterface

public Class getConfigurationInterface()
Returns the interface of the configuration.

Specified by:
getConfigurationInterface in interface Configuration
Returns:
PropertyConfiguration.class

getDataStructure

public org.jdom.Document getDataStructure()
Gets the document containing the root element.

Specified by:
getDataStructure in interface Configuration
Returns:
the document

getRootElement

public org.jdom.Element getRootElement()
Gets the root element of the configuration.

Specified by:
getRootElement in interface Configuration
Returns:
root element of the configuration

getConfigurationName

public String getConfigurationName()
Description copied from interface: Configuration

Returns the name of this configuration in the backing store, but may be null if the Configuration has not yet been saved to the backing store.

Specified by:
getConfigurationName in interface Configuration
Returns:
the fully-qualified path name of this Configuration in the backing store
See Also:
Configuration.getConfigurationName()

setConfigurationName

public void setConfigurationName(String name)
Description copied from interface: Configuration
Alters the name of this configuration document

Specified by:
setConfigurationName in interface Configuration
Parameters:
name - the new name of this configuration document
See Also:
Configuration.setConfigurationName(java.lang.String)

clone

public Object clone()
Description copied from interface: Configuration

This method makes a deep-copy of the underlying data structure for this configuration

Specified by:
clone in interface Configuration
Overrides:
clone in class Object
Returns:
the newly created copy of configuration
See Also:
Configuration.clone()

getBooleanProperty

public boolean getBooleanProperty(String propertyName)
Description copied from interface: PropertyConfiguration
Retrieves a configured boolean values

Specified by:
getBooleanProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
Returns:
retrieves a configured boolean
See Also:
PropertyConfiguration.getBooleanProperty(java.lang.String)

getBooleanProperty

public boolean getBooleanProperty(String propertyName,
                                  boolean defaultValue)
Description copied from interface: PropertyConfiguration
Retrieves a configured boolean values

Specified by:
getBooleanProperty in interface PropertyConfiguration
Parameters:
defaultValue - the default boolean to be returned if none is configured
propertyName - a dot ('.') delimeted path/key to the requested configuration value
Returns:
retrieves a configured boolean
See Also:
PropertyConfiguration.getBooleanProperty(java.lang.String)

getByteProperty

public byte getByteProperty(String propertyName)
Description copied from interface: PropertyConfiguration
Retrieves a configured byte property.

Specified by:
getByteProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
Returns:
the configured byte
See Also:
PropertyConfiguration.getByteProperty(java.lang.String)

getByteProperty

public byte getByteProperty(String propertyName,
                            byte defaultValue)
Description copied from interface: PropertyConfiguration
Retrieves a configured byte property.

Specified by:
getByteProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
defaultValue - the byte to be returned if none is configured
Returns:
the configured byte
See Also:
PropertyConfiguration.getByteProperty(java.lang.String)

getCSVProperty

public String[] getCSVProperty(String propertyName)
Description copied from interface: PropertyConfiguration
Retrieves an array of string values that are retrieved from the configuration document at the supplied key. These values should be seperated by commas (','). If no values are in the configuration, a 0 length array is returned.

Specified by:
getCSVProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
Returns:
the array of values
See Also:
PropertyConfiguration.getCSVProperty(java.lang.String)

getShortProperty

public short getShortProperty(String propertyName)
Description copied from interface: PropertyConfiguration
Retrieves a configured short value

Specified by:
getShortProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
Returns:
the configured short value
See Also:
PropertyConfiguration.getShortProperty(java.lang.String)

getShortProperty

public short getShortProperty(String propertyName,
                              short defaultValue)
Description copied from interface: PropertyConfiguration
Retrieves a configured short values

Specified by:
getShortProperty in interface PropertyConfiguration
Parameters:
defaultValue - the default short to be returned if none is configured
propertyName - a dot ('.') delimeted path/key to the requested configuration value
Returns:
the configured short
See Also:
PropertyConfiguration.getShortProperty(java.lang.String)

getDoubleProperty

public double getDoubleProperty(String propertyName)
Description copied from interface: PropertyConfiguration
Retrieves a configured double value

Specified by:
getDoubleProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
Returns:
the configured double value
See Also:
PropertyConfiguration.getDoubleProperty(java.lang.String)

getDoubleProperty

public double getDoubleProperty(String propertyName,
                                double defaultValue)
Description copied from interface: PropertyConfiguration
Retrieves a configured double values

Specified by:
getDoubleProperty in interface PropertyConfiguration
Parameters:
defaultValue - the default double to be returned if none is configured
propertyName - a dot ('.') delimeted path/key to the requested configuration value
Returns:
retrieves a configured double
See Also:
PropertyConfiguration.getDoubleProperty(java.lang.String)

getFloatProperty

public float getFloatProperty(String propertyName)
Description copied from interface: PropertyConfiguration
Retrieves a configured float value.

Specified by:
getFloatProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
Returns:
the configured float value.
See Also:
PropertyConfiguration.getFloatProperty(java.lang.String)

getFloatProperty

public float getFloatProperty(String propertyName,
                              float defaultValue)
Description copied from interface: PropertyConfiguration
Retrieves a configured float values

Specified by:
getFloatProperty in interface PropertyConfiguration
Parameters:
defaultValue - the default float to be returned if none is configured
propertyName - a dot ('.') delimeted path/key to the requested configuration value
Returns:
retrieves a configured float
See Also:
PropertyConfiguration.getFloatProperty(java.lang.String)

getIntProperty

public int getIntProperty(String propertyName)
Description copied from interface: PropertyConfiguration
Retrieves a configured int value

Specified by:
getIntProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
Returns:
the configured int property
See Also:
PropertyConfiguration.getIntProperty(java.lang.String)

getIntProperty

public int getIntProperty(String propertyName,
                          int defaultValue)
Description copied from interface: PropertyConfiguration
Retrieves a configured int values

Specified by:
getIntProperty in interface PropertyConfiguration
Parameters:
defaultValue - the default int to be returned if none is configured
propertyName - a dot ('.') delimeted path/key to the requested configuration value
Returns:
retrieves a configured int
See Also:
PropertyConfiguration.getIntProperty(java.lang.String)

getLongProperty

public long getLongProperty(String propertyName)
Description copied from interface: PropertyConfiguration
Retrieves a configured long property.

Specified by:
getLongProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
Returns:
the configured long property
See Also:
PropertyConfiguration.getLongProperty(java.lang.String)

getLongProperty

public long getLongProperty(String propertyName,
                            long defaultValue)
Description copied from interface: PropertyConfiguration
Retrieves a configured long values

Specified by:
getLongProperty in interface PropertyConfiguration
Parameters:
defaultValue - the default long to be returned if none is configured
propertyName - a dot ('.') delimeted path/key to the requested configuration value
Returns:
retrieves a configured long
See Also:
PropertyConfiguration.getLongProperty(java.lang.String)

getProperty

public String getProperty(String propertyName)
Description copied from interface: PropertyConfiguration
Retrieves a string property configuration

Specified by:
getProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
Returns:
the string value of the configuration
See Also:
PropertyConfiguration.getProperty(java.lang.String)

getProperty

public String getProperty(String propertyName,
                          String defaultValue)
Description copied from interface: PropertyConfiguration
Retrieves a string property configuration or returns the supplied default if none is found.

Specified by:
getProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
defaultValue - the value to be returned if not configured
Returns:
the requested configuration value or the default
See Also:
PropertyConfiguration.getProperty(java.lang.String)

getWSVProperty

public String[] getWSVProperty(String propertyName)
Description copied from interface: PropertyConfiguration
Retrieves an array of string values that are retrieved from the configuration document at the supplied key. These values should be seperated by white-space of any kind including spaces tabs or newlines. If no values are in the configuration, a 0 length array is returned.

Specified by:
getWSVProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
Returns:
the array of values
See Also:
PropertyConfiguration.getWSVProperty(java.lang.String)

getClassProperty

public Class getClassProperty(String propertyName)
Description copied from interface: PropertyConfiguration
Retrieves a configured class object

Specified by:
getClassProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
Returns:
retrieves the configured class object
See Also:
PropertyConfiguration.getClassProperty(java.lang.String)

getClassProperty

public Class getClassProperty(String propertyName,
                              Class defaultValue)
Description copied from interface: PropertyConfiguration
Retrieves a configured Class values

Specified by:
getClassProperty in interface PropertyConfiguration
Parameters:
defaultValue - a fully qualified class name to be returned if none is configured
propertyName - a dot ('.') delimeted path/key to the requested configuration value
Returns:
retrieves a configured class object
See Also:
PropertyConfiguration.getClassProperty(java.lang.String)

getDateProperty

public Date getDateProperty(String propertyName,
                            Date defaultValue)
Description copied from interface: PropertyConfiguration
Retrieves a configured Class values

Specified by:
getDateProperty in interface PropertyConfiguration
Parameters:
defaultValue - a fully qualified class name to be returned if none is configured
propertyName - a dot ('.') delimeted path/key to the requested configuration value
Returns:
retrieves a configured class object
See Also:
PropertyConfiguration.getDateProperty(java.lang.String)

getDateProperty

public Date getDateProperty(String propertyName)
Description copied from interface: PropertyConfiguration
Retrieves a configured class object

Specified by:
getDateProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
Returns:
retrieves the configured class object
See Also:
PropertyConfiguration.getDateProperty(java.lang.String)

setBooleanProperty

public void setBooleanProperty(String propertyName,
                               boolean value)
Description copied from interface: PropertyConfiguration
Sets the property named by propertyName to the value specified by value as a boolean

Specified by:
setBooleanProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
value - the new value
See Also:
PropertyConfiguration.setBooleanProperty(java.lang.String, boolean)

setByteProperty

public void setByteProperty(String propertyName,
                            byte value)
Description copied from interface: PropertyConfiguration
Sets the property named by propertyName to the value specified by value as a byte

Specified by:
setByteProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
value - the new value
See Also:
PropertyConfiguration.setByteProperty(java.lang.String, byte)

setClassProperty

public void setClassProperty(String propertyName,
                             Class value)
Description copied from interface: PropertyConfiguration
Sets the property named by propertyName to the value specified by value as a Class

Specified by:
setClassProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
value - the new value
See Also:
PropertyConfiguration.setClassProperty(java.lang.String, java.lang.Class)

setCSVProperty

public void setCSVProperty(String propertyName,
                           String[] values)
Description copied from interface: PropertyConfiguration
Sets the property named by propertyName to the value specified by value as a comma separated list of strings

Specified by:
setCSVProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
values - array of the new values that will be serialized, separated by commas
See Also:
PropertyConfiguration.setCSVProperty(java.lang.String, java.lang.String[])

setDateProperty

public void setDateProperty(String propertyName,
                            Date value)
Description copied from interface: PropertyConfiguration
Sets the property named by propertyName to the value specified by value as a Class

Specified by:
setDateProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
value - the new value
See Also:
PropertyConfiguration.setDateProperty(java.lang.String, java.util.Date)

setDoubleProperty

public void setDoubleProperty(String propertyName,
                              double value)
Description copied from interface: PropertyConfiguration
Sets the property named by propertyName to the value specified by value as a double

Specified by:
setDoubleProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
value - the new value
See Also:
PropertyConfiguration.setDoubleProperty(java.lang.String, double)

setFloatProperty

public void setFloatProperty(String propertyName,
                             float value)
Description copied from interface: PropertyConfiguration
Sets the property named by propertyName to the value specified by value as a float

Specified by:
setFloatProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
value - the new value
See Also:
PropertyConfiguration.setFloatProperty(java.lang.String, float)

setIntProperty

public void setIntProperty(String propertyName,
                           int value)
Description copied from interface: PropertyConfiguration
Sets the property named by propertyName to the value specified by value as a int

Specified by:
setIntProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
value - the new value
See Also:
PropertyConfiguration.setIntProperty(java.lang.String, int)

setLongProperty

public void setLongProperty(String propertyName,
                            long value)
Description copied from interface: PropertyConfiguration
Sets the property named by propertyName to the value specified by value as a long

Specified by:
setLongProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
value - the new value
See Also:
PropertyConfiguration.setLongProperty(java.lang.String, long)

setProperty

public void setProperty(String propertyName,
                        String value)
Description copied from interface: PropertyConfiguration
Sets the property named by propertyName to the value specified by value as a String

Specified by:
setProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
value - the new value
See Also:
PropertyConfiguration.setProperty(java.lang.String, java.lang.String)

setShortProperty

public void setShortProperty(String propertyName,
                             short value)
Description copied from interface: PropertyConfiguration
Sets the property named by propertyName to the value specified by value as a short

Specified by:
setShortProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
value - the new value
See Also:
PropertyConfiguration.setShortProperty(java.lang.String, short)

setWSVProperty

public void setWSVProperty(String propertyName,
                           String[] values)
Description copied from interface: PropertyConfiguration
Sets the property named by propertyName to the value specified by value as a white-space separated list of strings

Specified by:
setWSVProperty in interface PropertyConfiguration
Parameters:
propertyName - a dot ('.') delimeted path/key to the requested configuration value
values - array of the new values that will be serialized, separated by spaces.
See Also:
PropertyConfiguration.setWSVProperty(java.lang.String, java.lang.String[])

getProperty

private Object getProperty(String propertyName,
                           Object defaultValue,
                           Class type)
Centralized method for property lookup. This method will first lookup the text for the property in the propertyCache. If the text is not there it is retrieved from the document and cached. The text value is then converted to the appropriate type by the typeService. If the propertyText did not exist in the document, the defaultValue is returned.

Parameters:
propertyName - the name of the property to retreive a value for
defaultValue - the default value that will be returned if no value can be found
type - type of object to format the property text into and return
Returns:
Object

delimitedStringToArray

private String[] delimitedStringToArray(String delimitedValues,
                                        String delimiters)
Converts a String with values delimted by delimiters to an array of Strings. If there nare no values in delimitedValues, a 0 length array is returned.

Parameters:
delimitedValues - string to convert to string array
delimiters - delimiters to use in string conversion
Returns:
String[] the resulted array

arrayToDelimitedString

private String arrayToDelimitedString(String[] values,
                                      String delimiter)
Serializes an array of Strings into a single String with values delimited by delimiter

Parameters:
values - the array of values to delimit
delimiter - the delimiter to place between the values
Returns:
String the result string of the delimited values

isConfigurationWritable

public boolean isConfigurationWritable()
Is this configuration document writable or is it read-only. Shared cache instances of configuration objects should either be synchronized or marked not writable. When a configuration object is not writable, it should throw an exception if an attempt is made to modify it.

Specified by:
isConfigurationWritable in interface Configuration
Returns:
true if this cofiguration object may be altered.
Since:
carbon 1.1

setConfigurationReadOnly

public void setConfigurationReadOnly()
Sets whether this configuration may be altered.

Specified by:
setConfigurationReadOnly in interface Configuration
Since:
carbon 1.1

preloadProperyCache

private void preloadProperyCache(org.jdom.Element parentElement,
                                 String parentElementName)
Loads up the property cache with all the values.

Parameters:
parentElement - the parent element.
parentElementName - the name of the parent element.


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.