|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.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 Configuration
public 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 null
public 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 Configuration
public 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 null| Method Detail |
public java.lang.String getName()
getName in interface Configurationpublic void setName(java.lang.String name)
setName in interface MutableConfigurationname - The new node namepublic Configuration getParent()
getParent in interface Configurationpublic Configuration getChild(java.lang.String name)
getChild in interface Configurationname - The child name
public java.lang.String getChildValue(java.lang.String name)
getChildValue in interface Configurationname - The child name
public java.lang.String getChildValue(java.lang.String name,
java.lang.String defaultValue)
getChildValue in interface Configurationname - The child namedefaultValue - The default value
public java.util.List getChildren()
getChildren in interface Configurationpublic java.util.List getChildren(java.lang.String name)
getChildren in interface Configurationname - The child node name
public MutableConfiguration addChild(java.lang.String name)
addChild(name, null)
addChild in interface MutableConfigurationname - The name of the new configuration node
public MutableConfiguration addChild(java.lang.String name,
java.lang.Object value)
addChild in interface MutableConfigurationname - The name of the new configuration nodevalue - The value of the new configuration node
public void addChild(Configuration configuration)
addChild in interface MutableConfigurationconfiguration - The child configuration objectpublic void removeChild(Configuration configuration)
removeChild in interface MutableConfigurationconfiguration - The child configuration object
public void addAttribute(java.lang.String name,
java.lang.Object value)
addAttribute in interface MutableConfigurationname - The attribute namevalue - The attribute valuepublic void setValue(java.lang.String value)
setValue in interface MutableConfigurationvalue - The new valuepublic void clearChildren()
clearChildren in interface MutableConfigurationpublic java.util.List getAttributeNames()
getAttributeNames in interface Configurationpublic java.lang.String getAttribute(java.lang.String name)
getAttribute in interface Configurationname - The attribute name
public java.lang.String getAttribute(java.lang.String name,
java.lang.String defaultValue)
getAttribute in interface Configurationname - The attribute namedefaultValue - The default value
public java.lang.String getValue()
getValue in interface Configurationpublic java.lang.String getValue(java.lang.String defaultValue)
getValue in interface ConfigurationdefaultValue - The default value
public Location getLocation()
getLocation in interface Configuration
public void save(java.io.OutputStream out)
throws ConfigurationException
save in interface MutableConfigurationout - The OutputStream
ConfigurationException
public void save(java.io.Writer out)
throws ConfigurationException
save in interface MutableConfigurationout - The Writer
ConfigurationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||