java.io.Serializablepublic class DefaultImmutableConfiguration extends AbstractConfiguration implements java.io.Serializable
Configuration interface.| Modifier and Type | Field | Description |
|---|---|---|
protected static org.apache.avalon.framework.configuration.Configuration[] |
EMPTY_ARRAY |
An empty (length zero) array of configuration objects.
|
private java.util.HashMap |
m_attributes |
|
private java.util.ArrayList |
m_children |
|
private java.lang.String |
m_location |
|
private java.lang.String |
m_name |
|
private java.lang.String |
m_namespace |
|
private java.lang.String |
m_prefix |
|
private java.lang.String |
m_value |
| Constructor | Description |
|---|---|
DefaultImmutableConfiguration(org.apache.avalon.framework.configuration.Configuration config) |
Deep copy constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
equals(java.lang.Object other) |
Compare if this configuration is equal to another.
|
java.lang.String |
getAttribute(java.lang.String name) |
Returns the value of the attribute specified by its name as a
String. |
java.lang.String[] |
getAttributeNames() |
Return an array of all attribute names.
|
org.apache.avalon.framework.configuration.Configuration |
getChild(java.lang.String name,
boolean createNew) |
Return the first
Configuration object child of this
associated with the given name. |
int |
getChildCount() |
Return count of children.
|
org.apache.avalon.framework.configuration.Configuration[] |
getChildren() |
Return an array of
Configuration
elements containing all node children. |
org.apache.avalon.framework.configuration.Configuration[] |
getChildren(java.lang.String name) |
Return an array of
Configuration objects
children of this associated with the given name. |
java.lang.String |
getLocation() |
Returns a description of location of element.
|
java.lang.String |
getName() |
Returns the name of this configuration element.
|
java.lang.String |
getNamespace() |
Returns the namespace of this configuration element
|
protected java.lang.String |
getPrefix() |
Returns the prefix of the namespace
|
java.lang.String |
getValue() |
Returns the value of the configuration element as a
String. |
java.lang.String |
getValue(java.lang.String defaultValue) |
Returns the value of the configuration element as a
String. |
int |
hashCode() |
Obtaine the hashcode for this configuration.
|
getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDouble, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsFloat, getAttributeAsInteger, getAttributeAsInteger, getAttributeAsLong, getAttributeAsLong, getChild, getValueAsBoolean, getValueAsBoolean, getValueAsDouble, getValueAsDouble, getValueAsFloat, getValueAsFloat, getValueAsInteger, getValueAsInteger, getValueAsLong, getValueAsLong, toStringprotected static final org.apache.avalon.framework.configuration.Configuration[] EMPTY_ARRAY
private final java.lang.String m_name
private final java.lang.String m_location
private final java.lang.String m_namespace
private final java.lang.String m_prefix
private final java.util.HashMap m_attributes
private final java.util.ArrayList m_children
private final java.lang.String m_value
public DefaultImmutableConfiguration(org.apache.avalon.framework.configuration.Configuration config)
throws org.apache.avalon.framework.configuration.ConfigurationException
config - the Configuration to do a deep copy of.org.apache.avalon.framework.configuration.ConfigurationException - if an error occurs when copyingpublic java.lang.String getName()
String valuepublic java.lang.String getNamespace()
throws org.apache.avalon.framework.configuration.ConfigurationException
String valueorg.apache.avalon.framework.configuration.ConfigurationException - if an error occursprotected java.lang.String getPrefix()
throws org.apache.avalon.framework.configuration.ConfigurationException
getPrefix in class AbstractConfigurationString valueorg.apache.avalon.framework.configuration.ConfigurationException - if prefix is not present (null).public java.lang.String getLocation()
String valuepublic java.lang.String getValue(java.lang.String defaultValue)
String.getValue in class AbstractConfigurationdefaultValue - the default value to return if value malformed or emptyString valuepublic java.lang.String getValue()
throws org.apache.avalon.framework.configuration.ConfigurationException
String.String valueorg.apache.avalon.framework.configuration.ConfigurationException - If the value is not present.public java.lang.String[] getAttributeNames()
String[] valuepublic org.apache.avalon.framework.configuration.Configuration[] getChildren()
Configuration
elements containing all node children.public java.lang.String getAttribute(java.lang.String name)
throws org.apache.avalon.framework.configuration.ConfigurationException
String.name - a String valueString valueorg.apache.avalon.framework.configuration.ConfigurationException - If the attribute is not present.public org.apache.avalon.framework.configuration.Configuration getChild(java.lang.String name,
boolean createNew)
Configuration object child of this
associated with the given name.getChild in class AbstractConfigurationname - a String valuecreateNew - a boolean valueConfiguration valuepublic org.apache.avalon.framework.configuration.Configuration[] getChildren(java.lang.String name)
Configuration objects
children of this associated with the given name.
null.name - The name of the required children Configuration.Configuration[] valuepublic int getChildCount()
int valuepublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectother - The other configurationtrue if they are the same.public int hashCode()
hashCode in class java.lang.Object