public class DefaultImmutableConfiguration extends AbstractConfiguration implements Serializable
Configuration
interface.Modifier and Type | Field and Description |
---|---|
protected static Configuration[] |
EMPTY_ARRAY
An empty (length zero) array of configuration objects.
|
Constructor and Description |
---|
DefaultImmutableConfiguration(Configuration config)
Deep copy constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDouble, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsFloat, getAttributeAsInteger, getAttributeAsInteger, getAttributeAsLong, getAttributeAsLong, getChild, getValueAsBoolean, getValueAsBoolean, getValueAsDouble, getValueAsDouble, getValueAsFloat, getValueAsFloat, getValueAsInteger, getValueAsInteger, getValueAsLong, getValueAsLong, toString
protected static final Configuration[] EMPTY_ARRAY
public DefaultImmutableConfiguration(Configuration config) throws ConfigurationException
config
- the Configuration
to do a deep copy of.ConfigurationException
- if an error occurs when copyingpublic String getName()
getName
in interface Configuration
String
valuepublic String getNamespace() throws ConfigurationException
getNamespace
in interface Configuration
String
valueConfigurationException
- if an error occursprotected String getPrefix() throws ConfigurationException
getPrefix
in class AbstractConfiguration
String
valueConfigurationException
- if prefix is not present (null
).public String getLocation()
getLocation
in interface Configuration
String
valuepublic String getValue(String defaultValue)
String
.getValue
in interface Configuration
getValue
in class AbstractConfiguration
defaultValue
- the default value to return if value malformed or emptyString
valuepublic String getValue() throws ConfigurationException
String
.getValue
in interface Configuration
String
valueConfigurationException
- If the value is not present.public String[] getAttributeNames()
getAttributeNames
in interface Configuration
String[]
valuepublic Configuration[] getChildren()
Configuration
elements containing all node children.getChildren
in interface Configuration
public String getAttribute(String name) throws ConfigurationException
String
.getAttribute
in interface Configuration
name
- a String
valueString
valueConfigurationException
- If the attribute is not present.public Configuration getChild(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
valueConfiguration
valuepublic Configuration[] getChildren(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(Object other)
Copyright © 2024. All rights reserved.