com.anthonyeden.lib.config
Interface MutableConfiguration

All Superinterfaces:
Configuration
All Known Implementing Classes:
ConfigurationBase

public interface MutableConfiguration
extends Configuration

Interface implemented by configuration objects which are mutable.

Author:
Anthony Eden

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.
 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 interface com.anthonyeden.lib.config.Configuration
getAttribute, getAttribute, getAttributeNames, getChild, getChildren, getChildren, getChildValue, getChildValue, getLocation, getName, getParent, getValue, getValue
 

Method Detail

setName

public void setName(java.lang.String name)
Set the node name.

Parameters:
name - The new node name

addChild

public MutableConfiguration addChild(java.lang.String name)
Add a child node with no child value to the configuration. This method should be the same as calling addChild(name, null)

Parameters:
name - The name of the new configuration node
Returns:
The configuration node

addChild

public MutableConfiguration addChild(java.lang.String name,
                                     java.lang.Object value)
Add a child node to the configuration. The value's toString() method will be used to convert the value to a String.

Parameters:
name - The name of the new configuration node
value - The value of the new configuration node
Returns:
The configuration node

addChild

public void addChild(Configuration configuration)
Add the configuration object as a child of this configuration object.

Parameters:
configuration - The child configuration object

removeChild

public void removeChild(Configuration configuration)
Remove the specified configuration object.

Parameters:
configuration - The child configuration object

addAttribute

public void addAttribute(java.lang.String name,
                         java.lang.Object value)
Add an attribute with the given name. The value's toString() method will be used to convert the value to a String.

Parameters:
name - The attribute name
value - The attribute value

setValue

public void setValue(java.lang.String value)
Set the configuration object's value.

Parameters:
value - The new value

clearChildren

public void clearChildren()
Remove all of the children of this configuration node.


save

public void save(java.io.OutputStream out)
          throws ConfigurationException
Save the configuration data to the specified output stream. Not all implementations will support writing configuration data.

Parameters:
out - The OutputStream
Throws:
ConfigurationException

save

public void save(java.io.Writer out)
          throws ConfigurationException
Save the configuration data to the specified output stream. Not all implementations will support writing configuration data.

Parameters:
out - The Writer
Throws:
ConfigurationException


Copyright (c) 2000-2003 Anthony Eden. All Rights Reserved.