In memory Configuration implementation.
The developer should create the DefaultConfiguration,
associate value, attributes and/or child elements configuration
and then invoke
DefaultConfiguration.makeReadOnly() before passing the
Configuration to the client component.
version: $Revision: 1.2 $ $Date: 2004/05/01 09:51:48 $
Create a DefaultConfiguration instance.
Parameters: name - the name of configuration element Parameters: location - the location of configuration element in source Parameters: path - the path of configuration element in document
Return attribute value with specified name.
Parameters: name - the attribute name the attribute value throws: ConfigurationException - if no attribute withspecified name
Return attribute value with specified name.
If no attribute with specified name then return
default value.
Parameters: name - the attribute name Parameters: defaultValue - the default value the attribute value
Return attribute value with specified name as a boolean.
Parameters: name - the attribute name the attribute value throws: ConfigurationException - if no attribute withspecified name or attribute can not be convertedto correct type
getAttributeAsBoolean
public boolean getAttributeAsBoolean(String name, boolean defaultValue)(Code)
Return attribute value with specified name as a boolean.
If no attribute with specified name or attribute can
not be converted to correct type then return
default value.
Parameters: name - the attribute name Parameters: defaultValue - the default value the attribute value
Return attribute value with specified name as afloat.
Parameters: name - the attribute name the attribute value throws: ConfigurationException - if no attribute withspecified name or attribute can not be convertedto correct type
getAttributeAsFloat
public float getAttributeAsFloat(String name, float defaultValue)(Code)
Return attribute value with specified name as a float.
If no attribute with specified name or attribute can
not be converted to correct type then return
default value.
Parameters: name - the attribute name Parameters: defaultValue - the default value the attribute value
Return attribute value with specified name as an integer.
Parameters: name - the attribute name the attribute value throws: ConfigurationException - if no attribute withspecified name or attribute can not be convertedto correct type
getAttributeAsInteger
public int getAttributeAsInteger(String name, int defaultValue)(Code)
Return attribute value with specified name as an integer.
If no attribute with specified name or attribute can
not be converted to correct type then return
default value.
Parameters: name - the attribute name Parameters: defaultValue - the default value the attribute value
Return attribute value with specified name as a long.
Parameters: name - the attribute name the attribute value throws: ConfigurationException - if no attribute withspecified name or attribute can not be convertedto correct type
getAttributeAsLong
public long getAttributeAsLong(String name, long defaultValue)(Code)
Return attribute value with specified name as a long.
If no attribute with specified name or attribute can
not be converted to correct type then return
default value.
Parameters: name - the attribute name Parameters: defaultValue - the default value the attribute value
Return a child Configuration element with specified name.
If no such element exists an element will be autocreated.
Parameters: name - the name of child configuration object a child Configuration element with specified name.
Return a child Configuration element with specified name.
If no such element exists and createChild is true then an
element will be autocreated otherwise null will be returned.
Parameters: name - the name of child configuration object Parameters: createChild - true if child should be created if it does not exist a child Configuration element with specified name.
Return an array of all the child elements with specified name.
Parameters: name - the name of child configuration objects an array of all the child elements with specified name.
Return the location of configuration element.
Usually of the form "uri[:line number[:column number]]"
if possible. ie "file:myFile.xml:80:2". However the line
number and column number may be elided if unavailable.
the location of configuration element.
Return the path to the configuration element.
The path should be in the xpath form but may
be the empty string if unabel to determine path.
the path to the configuration element.
Return text value of element as a boolean.
the value throws: ConfigurationException - if no value in elementor value can not be converted to correct type
getValueAsBoolean
public boolean getValueAsBoolean(boolean defaultValue)(Code)
Return text value of element as a boolean.
Use specified default if no value in element or
value can not be converted to correct type.
Parameters: defaultValue - the default value the value
Return text value of element as a float.
the value throws: ConfigurationException - if no value in elementor value can not be converted to correct type
getValueAsFloat
public float getValueAsFloat(float defaultValue)(Code)
Return text value of element as a float.
Use specified default if no value in element or
value can not be converted to correct type.
Parameters: defaultValue - the default value the value
Return text value of element as an integer.
the value throws: ConfigurationException - if no value in elementor value can not be converted to correct type
getValueAsInteger
public int getValueAsInteger(int defaultValue)(Code)
Return text value of element as an integer.
Use specified default if no value in element or
value can not be converted to correct type.
Parameters: defaultValue - the default value the value
Return text value of element as a long.
the value throws: ConfigurationException - if no value in elementor value can not be converted to correct type
getValueAsLong
public long getValueAsLong(long defaultValue)(Code)
Return text value of element as a long.
Use specified default if no value in element or
value can not be converted to correct type.
Parameters: defaultValue - the default value the value