org.apache.avalon.framework.configuration
Class DefaultImmutableConfiguration
AbstractConfiguration
org.apache.avalon.framework.configuration.DefaultImmutableConfiguration
- Serializable
public class DefaultImmutableConfiguration
extends AbstractConfiguration
implements Serializable
An immutable implementation of the Configuration
interface.
CVS $Revision: 1.2 $ $Date: 2004/02/11 14:34:25 $protected static Configuration[] | EMPTY_ARRAY - An empty (length zero) array of configuration objects.
|
boolean | equals(Object other) - Compare if this configuration is equal to another.
|
String | getAttribute(String name) - Returns the value of the attribute specified by its name as a
String .
|
String[] | getAttributeNames() - Return an array of all attribute names.
|
Configuration | getChild(String name, boolean createNew) - Return the first
Configuration object child of this
associated with the given name.
|
int | getChildCount() - Return count of children.
|
Configuration[] | getChildren() - Return an array of
Configuration
elements containing all node children.
|
Configuration[] | getChildren(String name) - Return an array of
Configuration objects
children of this associated with the given name.
|
String | getLocation() - Returns a description of location of element.
|
String | getName() - Returns the name of this configuration element.
|
String | getNamespace() - Returns the namespace of this configuration element
|
protected String | getPrefix() - Returns the prefix of the namespace
|
String | getValue() - Returns the value of the configuration element as a
String .
|
String | getValue(String defaultValue) - Returns the value of the configuration element as a
String .
|
int | hashCode() - Obtaine the hashcode for this configuration.
|
EMPTY_ARRAY
protected static final Configuration[] EMPTY_ARRAY
An empty (length zero) array of configuration objects.
DefaultImmutableConfiguration
public DefaultImmutableConfiguration(Configuration config)
throws ConfigurationException
Deep copy constructor.
config
- the Configuration
to do a deep copy of.
equals
public boolean equals(Object other)
Compare if this configuration is equal to another.
other
- The other configuration
true
if they are the same.
getAttribute
public String getAttribute(String name)
throws ConfigurationException
Returns the value of the attribute specified by its name as a
String
.
getAttributeNames
public String[] getAttributeNames()
Return an array of all attribute names.
getChild
public Configuration getChild(String name,
boolean createNew)
Return the first Configuration
object child of this
associated with the given name.
name
- a String
valuecreateNew
- a boolean
value
getChildCount
public int getChildCount()
Return count of children.
getChildren
public Configuration[] getChildren()
Return an array of Configuration
elements containing all node children.
- The child nodes with name
getChildren
public Configuration[] getChildren(String name)
Return an array of Configuration
objects
children of this associated with the given name.
The returned array may be empty but is never null
.
name
- The name of the required children Configuration
.
getLocation
public String getLocation()
Returns a description of location of element.
getName
public String getName()
Returns the name of this configuration element.
getNamespace
public String getNamespace()
throws ConfigurationException
Returns the namespace of this configuration element
getPrefix
protected String getPrefix()
throws ConfigurationException
Returns the prefix of the namespace
getValue
public String getValue()
throws ConfigurationException
Returns the value of the configuration element as a String
.
getValue
public String getValue(String defaultValue)
Returns the value of the configuration element as a String
.
defaultValue
- the default value to return if value malformed or empty
hashCode
public int hashCode()
Obtaine the hashcode for this configuration.