|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.configuration.AbstractConfiguration org.apache.avalon.framework.configuration.DefaultImmutableConfiguration
An immutable implementation of the Configuration
interface.
Field Summary | |
protected static Configuration[] |
EMPTY_ARRAY
An empty (length zero) array of configuration objects. |
Constructor Summary | |
DefaultImmutableConfiguration(Configuration config)
Deep copy constructor. |
Method Summary | |
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. |
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. |
Configuration[] |
getChildren()
Return an array of Configuration
elements containing all node children. |
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. |
Methods inherited from class org.apache.avalon.framework.configuration.AbstractConfiguration |
getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDouble, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsFloat, getAttributeAsInteger, getAttributeAsInteger, getAttributeAsLong, getAttributeAsLong, getChild, getValueAsBoolean, getValueAsBoolean, getValueAsDouble, getValueAsDouble, getValueAsFloat, getValueAsFloat, getValueAsInteger, getValueAsInteger, getValueAsLong, getValueAsLong, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final Configuration[] EMPTY_ARRAY
Constructor Detail |
public DefaultImmutableConfiguration(Configuration config) throws ConfigurationException
config
- the Configuration
to do a deep copy of.
ConfigurationException
- if an error occurs when copyingMethod Detail |
public java.lang.String getName()
getName
in interface Configuration
String
valuepublic java.lang.String getNamespace() throws ConfigurationException
getNamespace
in interface Configuration
String
value
ConfigurationException
- if an error occursprotected java.lang.String getPrefix() throws ConfigurationException
getPrefix
in class AbstractConfiguration
String
value
ConfigurationException
- if prefix is not present (null
).public java.lang.String getLocation()
getLocation
in interface Configuration
String
valuepublic java.lang.String getValue(java.lang.String defaultValue)
String
.
getValue
in interface Configuration
getValue
in class AbstractConfiguration
defaultValue
- the default value to return if value malformed or empty
String
valuepublic java.lang.String getValue() throws ConfigurationException
String
.
getValue
in interface Configuration
String
value
ConfigurationException
- If the value is not present.public java.lang.String[] getAttributeNames()
getAttributeNames
in interface Configuration
String[]
valuepublic Configuration[] getChildren()
Configuration
elements containing all node children.
getChildren
in interface Configuration
public java.lang.String getAttribute(java.lang.String name) throws ConfigurationException
String
.
getAttribute
in interface Configuration
name
- a String
value
String
value
ConfigurationException
- If the attribute is not present.public Configuration getChild(java.lang.String name, boolean createNew)
Configuration
object child of this
associated with the given name.
getChild
in interface Configuration
getChild
in class AbstractConfiguration
name
- a String
valuecreateNew
- a boolean
value
Configuration
valuepublic Configuration[] getChildren(java.lang.String name)
Configuration
objects
children of this associated with the given name.
null
.
getChildren
in interface Configuration
name
- The name of the required children Configuration
.
Configuration[]
valuepublic int getChildCount()
int
valuepublic boolean equals(java.lang.Object other)
other
- The other configuration
true
if they are the same.public int hashCode()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |