nextapp.echoservlet.util
Class PropertyMap
java.lang.Object
java.util.AbstractMap
java.util.HashMap
nextapp.echoservlet.util.PropertyMap
- All Implemented Interfaces:
- java.lang.Cloneable, java.util.Map, java.io.Serializable
- public class PropertyMap
- extends java.util.HashMap
- implements java.io.Serializable
A Map that is generated from a properties file.
This class provides additional methods for returning properties
as Strings or arrays of Strings.
- See Also:
- Serialized Form
| Nested classes inherited from class java.util.HashMap |
|
| Nested classes inherited from class java.util.AbstractMap |
|
| Fields inherited from class java.util.HashMap |
|
| Fields inherited from class java.util.AbstractMap |
|
|
Constructor Summary |
PropertyMap(java.lang.String resourceName)
Create a PropertyMap |
|
Method Summary |
boolean |
getBoolean(java.lang.String key)
Returns true if the value identified by key is equal
to ""1"". |
int |
getInteger(java.lang.String key)
Returns the value identified by key as an
int if it the value is numeric. |
java.lang.String |
getString(java.lang.String key)
Returns the value identified by key as a
String if it is one, otherwise throws a
ClassCastException. |
void |
putBoolean(java.lang.String key,
boolean value)
Puts a boolean value. |
void |
putInteger(java.lang.String key,
int value)
Puts a integer value. |
| Methods inherited from class java.util.HashMap |
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
| Methods inherited from class java.util.AbstractMap |
equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
equals, hashCode |
PropertyMap
public PropertyMap(java.lang.String resourceName)
- Create a
PropertyMap
- Parameters:
resourceName - The name of the properties file to load.
getBoolean
public boolean getBoolean(java.lang.String key)
- Returns true if the value identified by
key is equal
to ""1"".
- Parameters:
key - the name of the property to return.
- Returns:
- true if the value of the property is "1".
getInteger
public int getInteger(java.lang.String key)
- Returns the value identified by
key as an
int if it the value is numeric. Zero is returned if the
value is null or otherwise not numeric.
- Parameters:
key - the name of the property to return.
- Returns:
- The integer value of the property.
getString
public java.lang.String getString(java.lang.String key)
- Returns the value identified by
key as a
String if it is one, otherwise throws a
ClassCastException.
- Parameters:
key - The name of the property to return.
- Returns:
- value The value of the property identified by
key
as a String.
putBoolean
public void putBoolean(java.lang.String key,
boolean value)
- Puts a boolean value.
- Parameters:
key - The key of the property to be set.value - The new value of the propert.
putInteger
public void putInteger(java.lang.String key,
int value)
- Puts a integer value.
- Parameters:
key - The key of the property to be set.value - The new value of the propert.