Class DefaultImmutableConfiguration
java.lang.Object
org.apache.avalon.framework.configuration.AbstractConfiguration
org.apache.avalon.framework.configuration.DefaultImmutableConfiguration
- All Implemented Interfaces:
Serializable
,Configuration
An immutable implementation of the
Configuration
interface.- Version:
- CVS $Revision: 1.2 $ $Date: 2004/02/11 14:34:25 $
- Author:
- Avalon Development Team
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Configuration[]
An empty (length zero) array of configuration objects. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compare if this configuration is equal to another.getAttribute
(String name) Returns the value of the attribute specified by its name as aString
.String[]
Return an array of all attribute names.Return the firstConfiguration
object child of this associated with the given name.int
Return count of children.Return an array ofConfiguration
elements containing all node children.getChildren
(String name) Return an array ofConfiguration
objects children of this associated with the given name.Returns a description of location of element.getName()
Returns the name of this configuration element.Returns the namespace of this configuration elementprotected String
Returns the prefix of the namespacegetValue()
Returns the value of the configuration element as aString
.Returns the value of the configuration element as aString
.int
hashCode()
Obtaine the hashcode for this configuration.Methods inherited from class org.apache.avalon.framework.configuration.AbstractConfiguration
getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsFloat, getAttributeAsFloat, getAttributeAsInteger, getAttributeAsInteger, getAttributeAsLong, getAttributeAsLong, getChild, getValueAsBoolean, getValueAsBoolean, getValueAsFloat, getValueAsFloat, getValueAsInteger, getValueAsInteger, getValueAsLong, getValueAsLong, toString
-
Field Details
-
EMPTY_ARRAY
An empty (length zero) array of configuration objects.
-
-
Constructor Details
-
DefaultImmutableConfiguration
Deep copy constructor.- Parameters:
config
- theConfiguration
to do a deep copy of.- Throws:
ConfigurationException
- if an error occurs when copying
-
-
Method Details
-
getName
Returns the name of this configuration element.- Specified by:
getName
in interfaceConfiguration
- Returns:
- a
String
value
-
getNamespace
Returns the namespace of this configuration element- Specified by:
getNamespace
in interfaceConfiguration
- Returns:
- a
String
value - Throws:
ConfigurationException
- if an error occurs- Since:
- 4.1
-
getPrefix
Returns the prefix of the namespace- Specified by:
getPrefix
in classAbstractConfiguration
- Returns:
- a
String
value - Throws:
ConfigurationException
- if prefix is not present (null
).- Since:
- 4.1
-
getLocation
Returns a description of location of element.- Specified by:
getLocation
in interfaceConfiguration
- Returns:
- a
String
value
-
getValue
Returns the value of the configuration element as aString
.- Specified by:
getValue
in interfaceConfiguration
- Overrides:
getValue
in classAbstractConfiguration
- Parameters:
defaultValue
- the default value to return if value malformed or empty- Returns:
- a
String
value
-
getValue
Returns the value of the configuration element as aString
.- Specified by:
getValue
in interfaceConfiguration
- Returns:
- a
String
value - Throws:
ConfigurationException
- If the value is not present.
-
getAttributeNames
Return an array of all attribute names.- Specified by:
getAttributeNames
in interfaceConfiguration
- Returns:
- a
String[]
value
-
getChildren
Return an array ofConfiguration
elements containing all node children.- Specified by:
getChildren
in interfaceConfiguration
- Returns:
- The child nodes with name
-
getAttribute
Returns the value of the attribute specified by its name as aString
.- Specified by:
getAttribute
in interfaceConfiguration
- Parameters:
name
- aString
value- Returns:
- a
String
value - Throws:
ConfigurationException
- If the attribute is not present.
-
getChild
Return the firstConfiguration
object child of this associated with the given name.- Specified by:
getChild
in interfaceConfiguration
- Overrides:
getChild
in classAbstractConfiguration
- Parameters:
name
- aString
valuecreateNew
- aboolean
value- Returns:
- a
Configuration
value
-
getChildren
Return an array ofConfiguration
objects children of this associated with the given name.
The returned array may be empty but is nevernull
.- Specified by:
getChildren
in interfaceConfiguration
- Parameters:
name
- The name of the required childrenConfiguration
.- Returns:
- a
Configuration[]
value
-
getChildCount
public int getChildCount()Return count of children.- Returns:
- an
int
value
-
equals
Compare if this configuration is equal to another. -
hashCode
public int hashCode()Obtaine the hashcode for this configuration.
-