Interface MutableConfiguration
- All Superinterfaces:
org.apache.avalon.framework.configuration.Configuration
- All Known Implementing Classes:
DefaultConfiguration
public interface MutableConfiguration
extends org.apache.avalon.framework.configuration.Configuration
A read/write extension of the Configuration interface.
- Since:
- 4.1.6
- Version:
- $Id: MutableConfiguration.java 156533 2005-03-08 08:51:40 -0600 (Tue, 08 Mar 2005) leif $
- Author:
- Avalon Development Team
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddAll(org.apache.avalon.framework.configuration.Configuration other) Add all the attributes, children and value from specified configuration element to current configuration element.voidaddAllAttributes(org.apache.avalon.framework.configuration.Configuration other) Add all attributes from specified configuration element to current configuration element.voidaddAllChildren(org.apache.avalon.framework.configuration.Configuration other) Add all childConfigurationobjects from specified configuration element to current configuration element.voidaddChild(org.apache.avalon.framework.configuration.Configuration configuration) Add a childConfigurationto this configuration element.getMutableChild(String name) Equivalent togetMutableChild( name, true )getMutableChild(String name, boolean autoCreate) Gets a child node of this configuration.Returns an array of mutable children.getMutableChildren(String name) Returns an array of mutable children with the given name.voidremoveChild(org.apache.avalon.framework.configuration.Configuration configuration) Remove a childConfigurationto this configuration element.voidsetAttribute(String name, boolean value) Set the value of the specified attribute to the specified boolean.voidsetAttribute(String name, double value) Set the value of the specified attribute to the specified double.voidsetAttribute(String name, float value) Set the value of the specified attribute to the specified float.voidsetAttribute(String name, int value) Set the value of the specified attribute to the specified int.voidsetAttribute(String name, long value) Set the value of the specified attribute to the specified long.voidsetAttribute(String name, String value) Set the value of the specified attribute to the specified string.voidsetValue(boolean value) Set the value of thisConfigurationobject to the specified boolean.voidsetValue(double value) Set the value of thisConfigurationobject to the specified double.voidsetValue(float value) Set the value of thisConfigurationobject to the specified float.voidsetValue(int value) Set the value of thisConfigurationobject to the specified int.voidsetValue(long value) Set the value of thisConfigurationobject to the specified long.voidSet the value of thisConfigurationobject to the specified string.Methods inherited from interface org.apache.avalon.framework.configuration.Configuration
getAttribute, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDouble, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsFloat, getAttributeAsInteger, getAttributeAsInteger, getAttributeAsLong, getAttributeAsLong, getAttributeNames, getChild, getChild, getChildren, getChildren, getLocation, getName, getNamespace, getValue, getValue, getValueAsBoolean, getValueAsBoolean, getValueAsDouble, getValueAsDouble, getValueAsFloat, getValueAsFloat, getValueAsInteger, getValueAsInteger, getValueAsLong, getValueAsLong
-
Method Details
-
setValue
Set the value of thisConfigurationobject to the specified string.- Parameters:
value- aStringvalue
-
setValue
void setValue(int value) Set the value of thisConfigurationobject to the specified int.- Parameters:
value- aintvalue
-
setValue
void setValue(long value) Set the value of thisConfigurationobject to the specified long.- Parameters:
value- alongvalue
-
setValue
void setValue(boolean value) Set the value of thisConfigurationobject to the specified boolean.- Parameters:
value- abooleanvalue
-
setValue
void setValue(float value) Set the value of thisConfigurationobject to the specified float.- Parameters:
value- afloatvalue
-
setValue
void setValue(double value) Set the value of thisConfigurationobject to the specified double.- Parameters:
value- adoublevalue
-
setAttribute
-
setAttribute
Set the value of the specified attribute to the specified int.- Parameters:
name- name of the attribute to setvalue- anintvalue
-
setAttribute
Set the value of the specified attribute to the specified long.- Parameters:
name- name of the attribute to setvalue- anlongvalue
-
setAttribute
Set the value of the specified attribute to the specified boolean.- Parameters:
name- name of the attribute to setvalue- anbooleanvalue
-
setAttribute
Set the value of the specified attribute to the specified float.- Parameters:
name- name of the attribute to setvalue- anfloatvalue
-
setAttribute
Set the value of the specified attribute to the specified double.- Parameters:
name- name of the attribute to setvalue- andoublevalue
-
addChild
void addChild(org.apache.avalon.framework.configuration.Configuration configuration) Add a childConfigurationto this configuration element.- Parameters:
configuration- aConfigurationvalue
-
addAll
void addAll(org.apache.avalon.framework.configuration.Configuration other) Add all the attributes, children and value from specified configuration element to current configuration element.- Parameters:
other- theConfigurationelement
-
addAllAttributes
void addAllAttributes(org.apache.avalon.framework.configuration.Configuration other) Add all attributes from specified configuration element to current configuration element.- Parameters:
other- theConfigurationelement
-
addAllChildren
void addAllChildren(org.apache.avalon.framework.configuration.Configuration other) Add all childConfigurationobjects from specified configuration element to current configuration element.- Parameters:
other- the otherConfigurationvalue
-
removeChild
void removeChild(org.apache.avalon.framework.configuration.Configuration configuration) Remove a childConfigurationto this configuration element.- Parameters:
configuration- aConfigurationvalue
-
getMutableChild
MutableConfiguration getMutableChild(String name) throws org.apache.avalon.framework.configuration.ConfigurationException Equivalent togetMutableChild( name, true )- Throws:
org.apache.avalon.framework.configuration.ConfigurationException
-
getMutableChild
MutableConfiguration getMutableChild(String name, boolean autoCreate) throws org.apache.avalon.framework.configuration.ConfigurationException Gets a child node of this configuration. If a mutable child with the given name exists, it is returned. If an immutable child with the given name exists, it is converted into a mutable child and returned. In this case, the immutable child will be replaced with the mutable child in this configuration (that is, it will be as if the child node always had been mutable). If no child with the given name exists, andautoCreateistrue, a new mutable child is created and added to this configuration before being returned.- Parameters:
name- the name of the child.autoCreate- set to true to create the child node if it doesn't exist.- Returns:
- the child MutableConfiguration, or
nullifautoCreatewas false and no child by the given name existed. - Throws:
org.apache.avalon.framework.configuration.ConfigurationException- if an error occurrs.
-
getMutableChildren
MutableConfiguration[] getMutableChildren() throws org.apache.avalon.framework.configuration.ConfigurationExceptionReturns an array of mutable children. Immutable children are converted just as forgetMutableChild.- Throws:
org.apache.avalon.framework.configuration.ConfigurationException- if an error occurrs.
-
getMutableChildren
MutableConfiguration[] getMutableChildren(String name) throws org.apache.avalon.framework.configuration.ConfigurationException Returns an array of mutable children with the given name. Immutable children are converted just as forgetMutableChild.- Throws:
org.apache.avalon.framework.configuration.ConfigurationException- if an error occurrs.
-