getAttribute
public String getAttribute(String name,
String defaultValue)
Returns the value of the attribute specified by its name as a
String
.
name
- the name of the attributedefaultValue
- the default value to return if value malformed or empty
getAttributeAsBoolean
public boolean getAttributeAsBoolean(String name)
throws ConfigurationException
Returns the value of the attribute specified by its name as a
boolean
.
name
- the name of the attribute
getAttributeAsBoolean
public boolean getAttributeAsBoolean(String name,
boolean defaultValue)
Returns the value of the attribute specified by its name as a
boolean
.
name
- the name of the attributedefaultValue
- the default value to return if value malformed or empty
getAttributeAsFloat
public float getAttributeAsFloat(String name)
throws ConfigurationException
Returns the value of the attribute specified by its name as a
float
.
name
- the name of the attribute
getAttributeAsFloat
public float getAttributeAsFloat(String name,
float defaultValue)
Returns the value of the attribute specified by its name as a
float
.
name
- the name of the attributedefaultValue
- the default value to return if value malformed or empty
getAttributeAsInteger
public int getAttributeAsInteger(String name)
throws ConfigurationException
Returns the value of the attribute specified by its name as an
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.
name
- the name of the attribute
getAttributeAsInteger
public int getAttributeAsInteger(String name,
int defaultValue)
Returns the value of the attribute specified by its name as an
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.
name
- the name of the attributedefaultValue
- the default value to return if value malformed or empty
getAttributeAsLong
public long getAttributeAsLong(String name)
throws ConfigurationException
Returns the value of the attribute specified by its name as a
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.
name
- the name of the attribute
getAttributeAsLong
public long getAttributeAsLong(String name,
long defaultValue)
Returns the value of the attribute specified by its name as a
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.
name
- the name of the attributedefaultValue
- the default value to return if value malformed or empty
getChild
public Configuration getChild(String name)
Return the first Configuration
object child of this
associated with the given name. If no such child exists, a new one
will be created.
name
- the name of the child
getChild
public Configuration getChild(String name,
boolean createNew)
Return the first Configuration
object child of this
associated with the given name.
name
- the name of the childcreateNew
- true if you want to create a new Configuration object if none exists
getPrefix
protected abstract String getPrefix()
throws ConfigurationException
Returns the prefix of the namespace. This is only used as a serialization
hint, therefore is not part of the client API. It should be included in
all Configuration implementations though.
- A non-null String (defaults to "")
getValue
public String getValue(String defaultValue)
Returns the value of the configuration element as a String
.
defaultValue
- the default value to return if value malformed or empty
getValueAsBoolean
public boolean getValueAsBoolean()
throws ConfigurationException
Returns the value of the configuration element as a boolean
.
getValueAsBoolean
public boolean getValueAsBoolean(boolean defaultValue)
Returns the value of the configuration element as a boolean
.
defaultValue
- the default value to return if value malformed or empty
getValueAsFloat
public float getValueAsFloat()
throws ConfigurationException
Returns the value of the configuration element as a float
.
getValueAsFloat
public float getValueAsFloat(float defaultValue)
Returns the value of the configuration element as a float
.
defaultValue
- the default value to return if value malformed or empty
getValueAsInteger
public int getValueAsInteger()
throws ConfigurationException
Returns the value of the configuration element as an 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
public int getValueAsInteger(int defaultValue)
Returns the value of the configuration element as an 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.
defaultValue
- the default value to return if value malformed or empty
getValueAsLong
public long getValueAsLong()
throws ConfigurationException
Returns the value of the configuration element as a 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
public long getValueAsLong(long defaultValue)
Returns the value of the configuration element as a 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.
defaultValue
- the default value to return if value malformed or empty
toString
public String toString()
The toString() operation is used for debugging information. It does
not create a deep reproduction of this configuration and all child configurations,
instead it displays the name, value, and location.
- getName() + "::" + getValue() + ":@" + getLocation();