|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Configuration interface.
| Method Summary | |
void |
addProperty(String key,
Object value)
Add a property to the configuration. |
void |
clearProperty(String key)
Clear a property in the configuration. |
boolean |
containsKey(String key)
Check if the configuration contains the key. |
boolean |
getBoolean(String key)
Get a boolean associated with the given configuration key. |
boolean |
getBoolean(String key,
boolean defaultValue)
Get a boolean associated with the given configuration key. |
Boolean |
getBoolean(String key,
Boolean defaultValue)
Get a boolean associated with the given configuration key. |
byte |
getByte(String key)
Get a byte associated with the given configuration key. |
byte |
getByte(String key,
byte defaultValue)
Get a byte associated with the given configuration key. |
Byte |
getByte(String key,
Byte defaultValue)
Get a byte associated with the given configuration key. |
double |
getDouble(String key)
Get a double associated with the given configuration key. |
double |
getDouble(String key,
double defaultValue)
Get a double associated with the given configuration key. |
Double |
getDouble(String key,
Double defaultValue)
Get a double associated with the given configuration key. |
float |
getFloat(String key)
Get a float associated with the given configuration key. |
float |
getFloat(String key,
float defaultValue)
Get a float associated with the given configuration key. |
Float |
getFloat(String key,
Float defaultValue)
Get a float associated with the given configuration key. |
int |
getInt(String key)
Get a int associated with the given configuration key. |
int |
getInt(String key,
int defaultValue)
Get a int associated with the given configuration key. |
Integer |
getInteger(String key,
Integer defaultValue)
Get a int associated with the given configuration key. |
Iterator |
getKeys()
Get the list of the keys contained in the configuration repository. |
Iterator |
getKeys(String prefix)
Get the list of the keys contained in the configuration repository that match the specified prefix. |
long |
getLong(String key)
Get a long associated with the given configuration key. |
long |
getLong(String key,
long defaultValue)
Get a long associated with the given configuration key. |
Long |
getLong(String key,
Long defaultValue)
Get a long associated with the given configuration key. |
Properties |
getProperties(String key)
Get a list of properties associated with the given configuration key. |
String |
getProperty(String key)
Gets a property from the configuration. |
short |
getShort(String key)
Get a short associated with the given configuration key. |
short |
getShort(String key,
short defaultValue)
Get a short associated with the given configuration key. |
Short |
getShort(String key,
Short defaultValue)
Get a short associated with the given configuration key. |
String |
getString(String key)
Get a string associated with the given configuration key. |
String |
getString(String key,
String defaultValue)
Get a string associated with the given configuration key. |
String[] |
getStringArray(String key)
Get an array of strings associated with the given configuration key. |
Vector |
getVector(String key)
Get a Vector of strings associated with the given configuration key. |
Vector |
getVector(String key,
Vector defaultValue)
Get a Vector of strings associated with the given configuration key. |
boolean |
isEmpty()
Check if the configuration is empty. |
void |
setProperty(String key,
Object value)
Set a property, this will replace any previously set values. |
Configuration |
subset(String prefix)
Create an Configuration object that is a subset of this one. |
| Method Detail |
public Configuration subset(String prefix)
prefix - The prefix used to select the properties.public boolean isEmpty()
public boolean containsKey(String key)
public void addProperty(String key,
Object value)
key - The Key to add the property to.value - The Value to add.
public void setProperty(String key,
Object value)
key - The key of the property to changevalue - The new valuepublic void clearProperty(String key)
key - the key to remove along with corresponding value.public String getProperty(String key)
key - property to retrieve
public Iterator getKeys(String prefix)
prefix - The prefix to test against.
public Iterator getKeys()
public Properties getProperties(String key)
key - The configuration key.
ClassCastException - is thrown if the key maps to an
object that is not a String/Vector.
IllegalArgumentException - if one of the tokens is
malformed (does not contain an equals sign).public boolean getBoolean(String key)
key - The configuration key.
NoSuchElementException - is thrown if the key doesn't
map to an existing object.
ClassCastException - is thrown if the key maps to an
object that is not a Boolean.
public boolean getBoolean(String key,
boolean defaultValue)
key - The configuration key.defaultValue - The default value.
ClassCastException - is thrown if the key maps to an
object that is not a Boolean.
public Boolean getBoolean(String key,
Boolean defaultValue)
key - The configuration key.defaultValue - The default value.
ClassCastException - is thrown if the key maps to an
object that is not a Boolean.public byte getByte(String key)
key - The configuration key.
NoSuchElementException - is thrown if the key doesn't
map to an existing object.
ClassCastException - is thrown if the key maps to an
object that is not a Byte.
NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
public byte getByte(String key,
byte defaultValue)
key - The configuration key.defaultValue - The default value.
ClassCastException - is thrown if the key maps to an
object that is not a Byte.
NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
public Byte getByte(String key,
Byte defaultValue)
key - The configuration key.defaultValue - The default value.
ClassCastException - is thrown if the key maps to an object that
is not a Byte.
NumberFormatException - is thrown if the value mapped by the key
has not a valid number format.public double getDouble(String key)
key - The configuration key.
NoSuchElementException - is thrown if the key doesn't
map to an existing object.
ClassCastException - is thrown if the key maps to an
object that is not a Double.
NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
public double getDouble(String key,
double defaultValue)
key - The configuration key.defaultValue - The default value.
ClassCastException - is thrown if the key maps to an
object that is not a Double.
NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
public Double getDouble(String key,
Double defaultValue)
key - The configuration key.defaultValue - The default value.
ClassCastException - is thrown if the key maps to an
object that is not a Double.
NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.public float getFloat(String key)
key - The configuration key.
NoSuchElementException - is thrown if the key doesn't
map to an existing object.
ClassCastException - is thrown if the key maps to an
object that is not a Float.
NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
public float getFloat(String key,
float defaultValue)
key - The configuration key.defaultValue - The default value.
ClassCastException - is thrown if the key maps to an
object that is not a Float.
NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
public Float getFloat(String key,
Float defaultValue)
key - The configuration key.defaultValue - The default value.
ClassCastException - is thrown if the key maps to an
object that is not a Float.
NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.public int getInt(String key)
key - The configuration key.
NoSuchElementException - is thrown if the key doesn't
map to an existing object.
ClassCastException - is thrown if the key maps to an
object that is not a Integer.
NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
public int getInt(String key,
int defaultValue)
key - The configuration key.defaultValue - The default value.
ClassCastException - is thrown if the key maps to an
object that is not a Integer.
NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
public Integer getInteger(String key,
Integer defaultValue)
key - The configuration key.defaultValue - The default value.
ClassCastException - is thrown if the key maps to an object that
is not a Integer.
NumberFormatException - is thrown if the value mapped by the key
has not a valid number format.public long getLong(String key)
key - The configuration key.
NoSuchElementException - is thrown if the key doesn't
map to an existing object.
ClassCastException - is thrown if the key maps to an
object that is not a Long.
NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
public long getLong(String key,
long defaultValue)
key - The configuration key.defaultValue - The default value.
ClassCastException - is thrown if the key maps to an
object that is not a Long.
NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
public Long getLong(String key,
Long defaultValue)
key - The configuration key.defaultValue - The default value.
ClassCastException - is thrown if the key maps to an
object that is not a Long.
NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.public short getShort(String key)
key - The configuration key.
NoSuchElementException - is thrown if the key doesn't
map to an existing object.
ClassCastException - is thrown if the key maps to an
object that is not a Short.
NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
public short getShort(String key,
short defaultValue)
key - The configuration key.defaultValue - The default value.
ClassCastException - is thrown if the key maps to an
object that is not a Short.
NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.
public Short getShort(String key,
Short defaultValue)
key - The configuration key.defaultValue - The default value.
ClassCastException - is thrown if the key maps to an
object that is not a Short.
NumberFormatException - is thrown if the value mapped
by the key has not a valid number format.public String getString(String key)
key - The configuration key.
ClassCastException - is thrown if the key maps to an object that
is not a String.
public String getString(String key,
String defaultValue)
key - The configuration key.defaultValue - The default value.
ClassCastException - is thrown if the key maps to an object that
is not a String.public String[] getStringArray(String key)
key - The configuration key.
ClassCastException - is thrown if the key maps to an
object that is not a String/Vector of Strings.public Vector getVector(String key)
key - The configuration key.
ClassCastException - is thrown if the key maps to an
object that is not a Vector.
public Vector getVector(String key,
Vector defaultValue)
key - The configuration key.defaultValue - The default value.
ClassCastException - is thrown if the key maps to an
object that is not a Vector.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||