getAttribute
public String getAttribute(String name,
String defaultValue)
Returns the value of the attribute specified by its name as a
String
.
- getAttribute in interface Configuration
name
- the name of the attributedefaultValue
- the default value to return if value malformed or empty
- the value
getAttributeAsBoolean
public boolean getAttributeAsBoolean(String name,
boolean defaultValue)
Returns the value of the attribute specified by its name as a
boolean
.
- getAttributeAsBoolean in interface Configuration
name
- the name of the attributedefaultValue
- the default value to return if value malformed or empty
- the value
getAttributeAsFloat
public float getAttributeAsFloat(String name,
float defaultValue)
Returns the value of the attribute specified by its name as a
float
.
- getAttributeAsFloat in interface Configuration
name
- the name of the attributedefaultValue
- the default value to return if value malformed or empty
- the value
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.
- getAttributeAsInteger in interface Configuration
name
- the name of the attribute
- the value
ConfigurationException
- if an error occurs
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.
- getAttributeAsInteger in interface Configuration
name
- the name of the attributedefaultValue
- the default value to return if value malformed or empty
- the value
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.
- getAttributeAsLong in interface Configuration
name
- the name of the attribute
- the value
ConfigurationException
- if an error occurs
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.
- getAttributeAsLong in interface Configuration
name
- the name of the attributedefaultValue
- the default value to return if value malformed or empty
- the value
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.
- getChild in interface Configuration
name
- the name of the child
- the child Configuration
getChild
public Configuration getChild(String name,
boolean createNew)
Return the first Configuration
object child of this
associated with the given name.
- getChild in interface Configuration
name
- the name of the childcreateNew
- true if you want to create a new Configuration object if none exists
- the child Configuration
getPrefix
protected 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 "")
ConfigurationException
- if no prefix was defined (prefix is
null
.
- 4.1
getValue
public String getValue(String defaultValue)
Returns the value of the configuration element as a String
.
- getValue in interface Configuration
defaultValue
- the default value to return if value malformed or empty
- the value
getValueAsBoolean
public boolean getValueAsBoolean(boolean defaultValue)
Returns the value of the configuration element as a boolean
.
- getValueAsBoolean in interface Configuration
defaultValue
- the default value to return if value malformed or empty
- the value
getValueAsFloat
public float getValueAsFloat(float defaultValue)
Returns the value of the configuration element as a float
.
- getValueAsFloat in interface Configuration
defaultValue
- the default value to return if value malformed or empty
- the value
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 in interface Configuration
- the value
ConfigurationException
- if an error occurs
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.
- getValueAsInteger in interface Configuration
defaultValue
- the default value to return if value malformed or empty
- the value
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 in interface Configuration
- the value
ConfigurationException
- if an error occurs
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.
- getValueAsLong in interface Configuration
defaultValue
- the default value to return if value malformed or empty
- the value