org.apache.avalon.framework.configuration.ConfigurationDefaultConfiguration, DefaultImmutableConfigurationpublic abstract class AbstractConfiguration
extends java.lang.Object
implements org.apache.avalon.framework.configuration.Configuration
Configuration implementation that deals
with methods that can be abstracted away from underlying implementations.| Constructor | Description |
|---|---|
AbstractConfiguration() |
| Modifier and Type | Method | Description |
|---|---|---|
java.lang.String |
getAttribute(java.lang.String name,
java.lang.String defaultValue) |
Returns the value of the attribute specified by its name as a
String. |
boolean |
getAttributeAsBoolean(java.lang.String name) |
Returns the value of the attribute specified by its name as a
boolean. |
boolean |
getAttributeAsBoolean(java.lang.String name,
boolean defaultValue) |
Returns the value of the attribute specified by its name as a
boolean. |
double |
getAttributeAsDouble(java.lang.String name) |
Returns the value of the attribute specified by its name as a
double. |
double |
getAttributeAsDouble(java.lang.String name,
double defaultValue) |
Returns the value of the attribute specified by its name as a
double. |
float |
getAttributeAsFloat(java.lang.String name) |
Returns the value of the attribute specified by its name as a
float. |
float |
getAttributeAsFloat(java.lang.String name,
float defaultValue) |
Returns the value of the attribute specified by its name as a
float. |
int |
getAttributeAsInteger(java.lang.String name) |
Returns the value of the attribute specified by its name as an
int. |
int |
getAttributeAsInteger(java.lang.String name,
int defaultValue) |
Returns the value of the attribute specified by its name as an
int. |
long |
getAttributeAsLong(java.lang.String name) |
Returns the value of the attribute specified by its name as a
long. |
long |
getAttributeAsLong(java.lang.String name,
long defaultValue) |
Returns the value of the attribute specified by its name as a
long. |
org.apache.avalon.framework.configuration.Configuration |
getChild(java.lang.String name) |
Return the first
Configuration object child of this
associated with the given name. |
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. |
protected abstract java.lang.String |
getPrefix() |
Returns the prefix of the namespace.
|
java.lang.String |
getValue(java.lang.String defaultValue) |
Returns the value of the configuration element as a
String. |
boolean |
getValueAsBoolean() |
Returns the value of the configuration element as a
boolean. |
boolean |
getValueAsBoolean(boolean defaultValue) |
Returns the value of the configuration element as a
boolean. |
double |
getValueAsDouble() |
Returns the value of the configuration element as a
double. |
double |
getValueAsDouble(double defaultValue) |
Returns the value of the configuration element as a
double. |
float |
getValueAsFloat() |
Returns the value of the configuration element as a
float. |
float |
getValueAsFloat(float defaultValue) |
Returns the value of the configuration element as a
float. |
int |
getValueAsInteger() |
Returns the value of the configuration element as an
int. |
int |
getValueAsInteger(int defaultValue) |
Returns the value of the configuration element as an
int. |
long |
getValueAsLong() |
Returns the value of the configuration element as a
long. |
long |
getValueAsLong(long defaultValue) |
Returns the value of the configuration element as a
long. |
private boolean |
isFalse(java.lang.String value) |
|
private boolean |
isTrue(java.lang.String value) |
|
java.lang.String |
toString() |
The toString() operation is used for debugging information.
|
protected abstract java.lang.String getPrefix()
throws org.apache.avalon.framework.configuration.ConfigurationException
org.apache.avalon.framework.configuration.ConfigurationException - if no prefix was defined (prefix is
null.public int getValueAsInteger()
throws org.apache.avalon.framework.configuration.ConfigurationException
int.
Hexadecimal numbers begin with 0x, Octal numbers begin with 0o and binary
numbers begin with 0b, all other values are assumed to be decimal.getValueAsInteger in interface org.apache.avalon.framework.configuration.Configurationorg.apache.avalon.framework.configuration.ConfigurationException - if an error occurspublic int getValueAsInteger(int defaultValue)
int.
Hexadecimal numbers begin with 0x, Octal numbers begin with 0o and binary
numbers begin with 0b, all other values are assumed to be decimal.getValueAsInteger in interface org.apache.avalon.framework.configuration.ConfigurationdefaultValue - the default value to return if value malformed or emptypublic long getValueAsLong()
throws org.apache.avalon.framework.configuration.ConfigurationException
long.
Hexadecimal numbers begin with 0x, Octal numbers begin with 0o and binary
numbers begin with 0b, all other values are assumed to be decimal.getValueAsLong in interface org.apache.avalon.framework.configuration.Configurationorg.apache.avalon.framework.configuration.ConfigurationException - if an error occurspublic long getValueAsLong(long defaultValue)
long.
Hexadecimal numbers begin with 0x, Octal numbers begin with 0o and binary
numbers begin with 0b, all other values are assumed to be decimal.getValueAsLong in interface org.apache.avalon.framework.configuration.ConfigurationdefaultValue - the default value to return if value malformed or emptypublic float getValueAsFloat()
throws org.apache.avalon.framework.configuration.ConfigurationException
float.getValueAsFloat in interface org.apache.avalon.framework.configuration.Configurationorg.apache.avalon.framework.configuration.ConfigurationException - if an error occurspublic float getValueAsFloat(float defaultValue)
float.getValueAsFloat in interface org.apache.avalon.framework.configuration.ConfigurationdefaultValue - the default value to return if value malformed or emptypublic double getValueAsDouble()
throws org.apache.avalon.framework.configuration.ConfigurationException
double.getValueAsDouble in interface org.apache.avalon.framework.configuration.Configurationorg.apache.avalon.framework.configuration.ConfigurationException - if an error occurspublic double getValueAsDouble(double defaultValue)
double.getValueAsDouble in interface org.apache.avalon.framework.configuration.ConfigurationdefaultValue - the default value to return if value malformed or emptypublic boolean getValueAsBoolean()
throws org.apache.avalon.framework.configuration.ConfigurationException
boolean.getValueAsBoolean in interface org.apache.avalon.framework.configuration.Configurationorg.apache.avalon.framework.configuration.ConfigurationException - if an error occurspublic boolean getValueAsBoolean(boolean defaultValue)
boolean.getValueAsBoolean in interface org.apache.avalon.framework.configuration.ConfigurationdefaultValue - the default value to return if value malformed or emptypublic java.lang.String getValue(java.lang.String defaultValue)
String.getValue in interface org.apache.avalon.framework.configuration.ConfigurationdefaultValue - the default value to return if value malformed or emptypublic int getAttributeAsInteger(java.lang.String name)
throws org.apache.avalon.framework.configuration.ConfigurationException
int.
Hexadecimal numbers begin with 0x, Octal numbers begin with 0o and binary
numbers begin with 0b, all other values are assumed to be decimal.getAttributeAsInteger in interface org.apache.avalon.framework.configuration.Configurationname - the name of the attributeorg.apache.avalon.framework.configuration.ConfigurationException - if an error occurspublic int getAttributeAsInteger(java.lang.String name,
int defaultValue)
int.
Hexadecimal numbers begin with 0x, Octal numbers begin with 0o and binary
numbers begin with 0b, all other values are assumed to be decimal.getAttributeAsInteger in interface org.apache.avalon.framework.configuration.Configurationname - the name of the attributedefaultValue - the default value to return if value malformed or emptypublic long getAttributeAsLong(java.lang.String name)
throws org.apache.avalon.framework.configuration.ConfigurationException
long.
Hexadecimal numbers begin with 0x, Octal numbers begin with 0o and binary
numbers begin with 0b, all other values are assumed to be decimal.getAttributeAsLong in interface org.apache.avalon.framework.configuration.Configurationname - the name of the attributeorg.apache.avalon.framework.configuration.ConfigurationException - if an error occurspublic long getAttributeAsLong(java.lang.String name,
long defaultValue)
long.
Hexadecimal numbers begin with 0x, Octal numbers begin with 0o and binary
numbers begin with 0b, all other values are assumed to be decimal.getAttributeAsLong in interface org.apache.avalon.framework.configuration.Configurationname - the name of the attributedefaultValue - the default value to return if value malformed or emptypublic float getAttributeAsFloat(java.lang.String name)
throws org.apache.avalon.framework.configuration.ConfigurationException
float.getAttributeAsFloat in interface org.apache.avalon.framework.configuration.Configurationname - the name of the attributeorg.apache.avalon.framework.configuration.ConfigurationException - if an error occurspublic float getAttributeAsFloat(java.lang.String name,
float defaultValue)
float.getAttributeAsFloat in interface org.apache.avalon.framework.configuration.Configurationname - the name of the attributedefaultValue - the default value to return if value malformed or emptypublic double getAttributeAsDouble(java.lang.String name)
throws org.apache.avalon.framework.configuration.ConfigurationException
double.getAttributeAsDouble in interface org.apache.avalon.framework.configuration.Configurationname - the name of the attributeorg.apache.avalon.framework.configuration.ConfigurationException - if an error occurspublic double getAttributeAsDouble(java.lang.String name,
double defaultValue)
double.getAttributeAsDouble in interface org.apache.avalon.framework.configuration.Configurationname - the name of the attributedefaultValue - the default value to return if value malformed or emptypublic boolean getAttributeAsBoolean(java.lang.String name)
throws org.apache.avalon.framework.configuration.ConfigurationException
boolean.getAttributeAsBoolean in interface org.apache.avalon.framework.configuration.Configurationname - the name of the attributeorg.apache.avalon.framework.configuration.ConfigurationException - if an error occursprivate boolean isTrue(java.lang.String value)
private boolean isFalse(java.lang.String value)
public boolean getAttributeAsBoolean(java.lang.String name,
boolean defaultValue)
boolean.getAttributeAsBoolean in interface org.apache.avalon.framework.configuration.Configurationname - the name of the attributedefaultValue - the default value to return if value malformed or emptypublic java.lang.String getAttribute(java.lang.String name,
java.lang.String defaultValue)
String.getAttribute in interface org.apache.avalon.framework.configuration.Configurationname - the name of the attributedefaultValue - the default value to return if value malformed or emptypublic org.apache.avalon.framework.configuration.Configuration getChild(java.lang.String name)
Configuration object child of this
associated with the given name. If no such child exists, a new one
will be created.getChild in interface org.apache.avalon.framework.configuration.Configurationname - the name of the childpublic 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 interface org.apache.avalon.framework.configuration.Configurationname - the name of the childcreateNew - true if you want to create a new Configuration object if none existspublic java.lang.String toString()
toString in class java.lang.Object