DefaultConfiguration
public DefaultConfiguration(String name)
Create a new DefaultConfiguration instance.
name - a String value
DefaultConfiguration
public DefaultConfiguration(String name,
String location) Create a new DefaultConfiguration instance.
name - a String valuelocation - a String value
DefaultConfiguration
public DefaultConfiguration(String name,
String location,
String ns,
String prefix) Create a new DefaultConfiguration instance.
name - config node namelocation - Builder-specific locator stringns - Namespace string (typically a URI). Should not be null; use ""
if no namespace.prefix - A short string prefixed to element names, associating
elements with a longer namespace string. Should not be null; use "" if no
namespace.
- 4.1
addAll
public void addAll(Configuration other)
Add all the attributes, children and value
from specified configuration element to current
configuration element.
other - the Configuration element
addAllAttributes
public void addAllAttributes(Configuration other)
Add all attributes from specified configuration
element to current configuration element.
other - the Configuration element
addAllChildren
public void addAllChildren(Configuration other)
Add all child Configuration objects from specified
configuration element to current configuration element.
other - the other Configuration value
addAttribute
public String addAttribute(String name,
String value)Use setAttribute() instead
Add an attribute to this configuration element, returning its old
value or null.
name - a String valuevalue - a String value
- a
String value
addChild
public void addChild(Configuration configuration)
Add a child Configuration to this configuration element.
configuration - a Configuration value
appendValueData
public void appendValueData(String value)
Use setValue() instead
Append data to the value of this configuration element.
value - a String value
checkWriteable
protected final void checkWriteable()
throws IllegalStateException heck if this configuration is writeable.
getAttributeNames
public String[] getAttributeNames()
Return an array of all attribute names.
- getAttributeNames in interface Configuration
- a
String[] value
getChild
public Configuration getChild(String name,
boolean createNew) Return the first Configuration object child of this
associated with the given name.
- getChild in interface Configuration
- getChild in interface AbstractConfiguration
name - a String valuecreateNew - a boolean value
- a
Configuration value
getChildCount
public int getChildCount()
Return count of children.
- an
int value
getChildren
public Configuration[] getChildren(String name)
Return an array of Configuration objects
children of this associated with the given name.
The returned array may be empty but is never null.
- getChildren in interface Configuration
name - The name of the required children Configuration.
- a
Configuration[] value
getLocation
public String getLocation()
Returns a description of location of element.
- getLocation in interface Configuration
- a
String value
getName
public String getName()
Returns the name of this configuration element.
- getName in interface Configuration
- a
String value
getValue
public String getValue(String defaultValue)
Returns the value of the configuration element as a String.
- getValue in interface Configuration
- getValue in interface AbstractConfiguration
defaultValue - the default value to return if value malformed or empty
- a
String value
makeReadOnly
public void makeReadOnly()
Make this configuration read-only.
removeChild
public void removeChild(Configuration configuration)
Remove a child Configuration to this configuration element.
configuration - a Configuration value
setAttribute
public void setAttribute(String name,
String value) Set the value of the specified attribute to the specified string.
name - name of the attribute to setvalue - a String value
setValue
public void setValue(String value)
Set the value of this Configuration object to the specified string.
value - a String value