|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.anthonyeden.lib.config.ConfigurationBase
The ConfigurationBase is a base implementation of the MutableConfiguration interface.
Field Summary | |
static java.lang.String |
ENCODING
|
Constructor Summary | |
ConfigurationBase(java.lang.String name,
java.lang.Object value,
Configuration parent)
Construct a new ConfigurationBase object. |
|
ConfigurationBase(java.lang.String name,
java.lang.Object value,
Configuration parent,
Location location)
Construct a new ConfigurationBase object. |
|
ConfigurationBase(java.lang.String name,
java.lang.Object value,
java.util.List children,
java.util.Map attributes,
Configuration parent)
Construct a new ConfigurationBase object. |
|
ConfigurationBase(java.lang.String name,
java.lang.Object value,
java.util.List children,
java.util.Map attributes,
Configuration parent,
Location location)
Construct a new ConfigurationBase object. |
Method Summary | |
void |
addAttribute(java.lang.String name,
java.lang.Object value)
Add an attribute with the given name. |
void |
addChild(Configuration configuration)
Add the configuration object as a child of this configuration object. |
MutableConfiguration |
addChild(java.lang.String name)
Add a child node with no child value to the configuration. |
MutableConfiguration |
addChild(java.lang.String name,
java.lang.Object value)
Add a child node to the configuration. |
void |
clearChildren()
Remove all of the children of this configuration node. |
java.lang.String |
getAttribute(java.lang.String name)
Get the named attribute or null. |
java.lang.String |
getAttribute(java.lang.String name,
java.lang.String defaultValue)
Get the named attribute. |
java.util.List |
getAttributeNames()
Get a List of attribute names. |
Configuration |
getChild(java.lang.String name)
Get the child configuration object with the given name. |
java.util.List |
getChildren()
Get a list of all child nodes. |
java.util.List |
getChildren(java.lang.String name)
Get a list of all child nodes with the given name. |
java.lang.String |
getChildValue(java.lang.String name)
Get the value of the first child configuration object with the given name. |
java.lang.String |
getChildValue(java.lang.String name,
java.lang.String defaultValue)
Get the value of the first child configuration object with the given name. |
Location |
getLocation()
Get location information for this configuration object. |
java.lang.String |
getName()
Get the node's name. |
Configuration |
getParent()
Get the parent configuration object. |
java.lang.String |
getValue()
Get the node's value or null if the node contains no data. |
java.lang.String |
getValue(java.lang.String defaultValue)
Get the node's value. |
void |
removeChild(Configuration configuration)
Remove the specified configuration object. |
void |
save(java.io.OutputStream out)
Save the configuration data to the specified output stream. |
void |
save(java.io.Writer out)
Save the configuration data to the specified output stream. |
void |
setName(java.lang.String name)
Set the node name. |
void |
setValue(java.lang.String value)
Set the configuration object's value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String ENCODING
Constructor Detail |
public ConfigurationBase(java.lang.String name, java.lang.Object value, Configuration parent)
name
- The configuration object namevalue
- The configuration object valueparent
- The parent Configurationpublic ConfigurationBase(java.lang.String name, java.lang.Object value, Configuration parent, Location location)
name
- The configuration object namevalue
- The configuration object valueparent
- The parent Configurationlocation
- The Location object or nullpublic ConfigurationBase(java.lang.String name, java.lang.Object value, java.util.List children, java.util.Map attributes, Configuration parent)
name
- The configuration object namevalue
- The configuration object valuechildren
- The List of childrenattributes
- The Map of attributesparent
- The parent Configurationpublic ConfigurationBase(java.lang.String name, java.lang.Object value, java.util.List children, java.util.Map attributes, Configuration parent, Location location)
name
- The configuration object namevalue
- The configuration object valuechildren
- The List of childrenattributes
- The Map of attributesparent
- The parent Configurationlocation
- The Location or nullMethod Detail |
public java.lang.String getName()
getName
in interface Configuration
public void setName(java.lang.String name)
setName
in interface MutableConfiguration
name
- The new node namepublic Configuration getParent()
getParent
in interface Configuration
public Configuration getChild(java.lang.String name)
getChild
in interface Configuration
name
- The child name
public java.lang.String getChildValue(java.lang.String name)
getChildValue
in interface Configuration
name
- The child name
public java.lang.String getChildValue(java.lang.String name, java.lang.String defaultValue)
getChildValue
in interface Configuration
name
- The child namedefaultValue
- The default value
public java.util.List getChildren()
getChildren
in interface Configuration
public java.util.List getChildren(java.lang.String name)
getChildren
in interface Configuration
name
- The child node name
public MutableConfiguration addChild(java.lang.String name)
addChild(name, null)
addChild
in interface MutableConfiguration
name
- The name of the new configuration node
public MutableConfiguration addChild(java.lang.String name, java.lang.Object value)
addChild
in interface MutableConfiguration
name
- The name of the new configuration nodevalue
- The value of the new configuration node
public void addChild(Configuration configuration)
addChild
in interface MutableConfiguration
configuration
- The child configuration objectpublic void removeChild(Configuration configuration)
removeChild
in interface MutableConfiguration
configuration
- The child configuration objectpublic void addAttribute(java.lang.String name, java.lang.Object value)
addAttribute
in interface MutableConfiguration
name
- The attribute namevalue
- The attribute valuepublic void setValue(java.lang.String value)
setValue
in interface MutableConfiguration
value
- The new valuepublic void clearChildren()
clearChildren
in interface MutableConfiguration
public java.util.List getAttributeNames()
getAttributeNames
in interface Configuration
public java.lang.String getAttribute(java.lang.String name)
getAttribute
in interface Configuration
name
- The attribute name
public java.lang.String getAttribute(java.lang.String name, java.lang.String defaultValue)
getAttribute
in interface Configuration
name
- The attribute namedefaultValue
- The default value
public java.lang.String getValue()
getValue
in interface Configuration
public java.lang.String getValue(java.lang.String defaultValue)
getValue
in interface Configuration
defaultValue
- The default value
public Location getLocation()
getLocation
in interface Configuration
public void save(java.io.OutputStream out) throws ConfigurationException
save
in interface MutableConfiguration
out
- The OutputStream
ConfigurationException
public void save(java.io.Writer out) throws ConfigurationException
save
in interface MutableConfiguration
out
- The Writer
ConfigurationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |