Top Description Methods
org.apache.avalon.framework.configuration

public Interface MutableConfiguration

extends Configuration
Known Direct Implementers
org.apache.avalon.framework.configuration.DefaultConfiguration

A read/write extension of the Configuration interface.
Author
Avalon Development Team
Since
4.1.6
Version
$Id: MutableConfiguration.java 506231 2007-02-12 02:36:54Z crossley $

Method Summary

Modifier and TypeMethod and Description
public void
addAll(final Configuration
the Configuration element
other
)

Add all the attributes, children and value from specified configuration element to current configuration element.

public void
addAllAttributes(final Configuration
the Configuration element
other
)

Add all attributes from specified configuration element to current configuration element.

public void
addAllChildren(final Configuration
the other Configuration value
other
)

Add all child Configuration objects from specified configuration element to current configuration element.

public void
addChild(final Configuration
a Configuration value
configuration
)

Add a child Configuration to this configuration element.

public MutableConfiguration
getMutableChild(final String name)

Equivalent to getMutableChild( name, true )

public MutableConfiguration

Returns:

the child MutableConfiguration, or null if autoCreate was false and no child by the given name existed.
getMutableChild
(final String
the name of the child.
name
,
boolean
set to true to create the child node if it doesn't exist.
autoCreate
)

Gets a child node of this configuration.

public MutableConfiguration[]
getMutableChildren()

Returns an array of mutable children.

public MutableConfiguration[]
getMutableChildren(final String name)

Returns an array of mutable children with the given name.

public void
removeChild(final Configuration
a Configuration value
configuration
)

Remove a child Configuration to this configuration element.

public void
setAttribute(final String
name of the attribute to set
name
,
final String
a String value. If null, the attribute is removed.
value
)

Set the value of the specified attribute to the specified string.

public void
setAttribute(final String
name of the attribute to set
name
,
final int
an int value
value
)

Set the value of the specified attribute to the specified int.

public void
setAttribute(final String
name of the attribute to set
name
,
final long
an long value
value
)

Set the value of the specified attribute to the specified long.

public void
setAttribute(final String
name of the attribute to set
name
,
final boolean
an boolean value
value
)

Set the value of the specified attribute to the specified boolean.

public void
setAttribute(final String
name of the attribute to set
name
,
final float
an float value
value
)

Set the value of the specified attribute to the specified float.

public void
setAttribute(final String
name of the attribute to set
name
,
final double
an double value
value
)

Set the value of the specified attribute to the specified double.

public void
setValue(final String
a String value
value
)

Set the value of this Configuration object to the specified string.

public void
setValue(final int
a int value
value
)

Set the value of this Configuration object to the specified int.

public void
setValue(final long
a long value
value
)

Set the value of this Configuration object to the specified long.

public void
setValue(final boolean
a boolean value
value
)

Set the value of this Configuration object to the specified boolean.

public void
setValue(final float
a float value
value
)

Set the value of this Configuration object to the specified float.

public void
setValue(final double
a double value
value
)

Set the value of this Configuration object to the specified double.

Inherited from org.apache.avalon.framework.configuration.Configuration:
getAttributegetAttributegetAttributeAsBooleangetAttributeAsBooleangetAttributeAsDoublegetAttributeAsDoublegetAttributeAsFloatgetAttributeAsFloatgetAttributeAsIntegergetAttributeAsIntegergetAttributeAsLonggetAttributeAsLonggetAttributeNamesgetChildgetChildgetChildrengetChildrengetLocationgetNamegetNamespacegetValuegetValuegetValueAsBooleangetValueAsBooleangetValueAsDoublegetValueAsDoublegetValueAsFloatgetValueAsFloatgetValueAsIntegergetValueAsIntegergetValueAsLonggetValueAsLong

Method Detail

addAllback to summary
public void addAll(final Configuration other)

Add all the attributes, children and value from specified configuration element to current configuration element.

Parameters
other:Configuration

the Configuration element

addAllAttributesback to summary
public void addAllAttributes(final Configuration other)

Add all attributes from specified configuration element to current configuration element.

Parameters
other:Configuration

the Configuration element

addAllChildrenback to summary
public void addAllChildren(final Configuration other)

Add all child Configuration objects from specified configuration element to current configuration element.

Parameters
other:Configuration

the other Configuration value

addChildback to summary
public void addChild(final Configuration configuration)

Add a child Configuration to this configuration element.

Parameters
configuration:Configuration

a Configuration value

getMutableChildback to summary
public MutableConfiguration getMutableChild(final String name) throws ConfigurationException

Equivalent to getMutableChild( name, true )

getMutableChildback to summary
public MutableConfiguration getMutableChild(final String name, boolean autoCreate) throws 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, and autoCreate is true, a new mutable child is created and added to this configuration before being returned.

Parameters
name:String

the name of the child.

autoCreate:boolean

set to true to create the child node if it doesn't exist.

Returns:MutableConfiguration

the child MutableConfiguration, or null if autoCreate was false and no child by the given name existed.

Exceptions
ConfigurationException:
if an error occurrs.
getMutableChildrenback to summary
public MutableConfiguration[] getMutableChildren() throws ConfigurationException

Returns an array of mutable children. Immutable children are converted just as for getMutableChild.

Exceptions
ConfigurationException:
if an error occurrs.
getMutableChildrenback to summary
public MutableConfiguration[] getMutableChildren(final String name) throws ConfigurationException

Returns an array of mutable children with the given name. Immutable children are converted just as for getMutableChild.

Exceptions
ConfigurationException:
if an error occurrs.
removeChildback to summary
public void removeChild(final Configuration configuration)

Remove a child Configuration to this configuration element.

Parameters
configuration:Configuration

a Configuration value

setAttributeback to summary
public void setAttribute(final String name, final String value)

Set the value of the specified attribute to the specified string.

Parameters
name:String

name of the attribute to set

value:String

a String value. If null, the attribute is removed.

setAttributeback to summary
public void setAttribute(final String name, final int value)

Set the value of the specified attribute to the specified int.

Parameters
name:String

name of the attribute to set

value:int

an int value

setAttributeback to summary
public void setAttribute(final String name, final long value)

Set the value of the specified attribute to the specified long.

Parameters
name:String

name of the attribute to set

value:long

an long value

setAttributeback to summary
public void setAttribute(final String name, final boolean value)

Set the value of the specified attribute to the specified boolean.

Parameters
name:String

name of the attribute to set

value:boolean

an boolean value

setAttributeback to summary
public void setAttribute(final String name, final float value)

Set the value of the specified attribute to the specified float.

Parameters
name:String

name of the attribute to set

value:float

an float value

setAttributeback to summary
public void setAttribute(final String name, final double value)

Set the value of the specified attribute to the specified double.

Parameters
name:String

name of the attribute to set

value:double

an double value

setValueback to summary
public void setValue(final String value)

Set the value of this Configuration object to the specified string.

Parameters
value:String

a String value

setValueback to summary
public void setValue(final int value)

Set the value of this Configuration object to the specified int.

Parameters
value:int

a int value

setValueback to summary
public void setValue(final long value)

Set the value of this Configuration object to the specified long.

Parameters
value:long

a long value

setValueback to summary
public void setValue(final boolean value)

Set the value of this Configuration object to the specified boolean.

Parameters
value:boolean

a boolean value

setValueback to summary
public void setValue(final float value)

Set the value of this Configuration object to the specified float.

Parameters
value:float

a float value

setValueback to summary
public void setValue(final double value)

Set the value of this Configuration object to the specified double.

Parameters
value:double

a double value