java.lang.Object | +--java.util.Dictionary | +--java.util.Hashtable | +--com.ibm.commerce.datatype.TypedProperty
TypedProperties extends java.util.Hashtable
. It provides
additional methods for retrieving properties such as
java.lang.Integer
, java.lang.Double
,
java.lang.Float
, java.lang.String
instead of
java.lang.Object
.
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT The IBM Copyright notice field. |
protected
static UrlParamMapperFile |
urlMapperFile The URL parameter mapping file for converting ECML parameters to a WebSphere Commerce parameter name. |
protected
java.util.Hashtable |
urlNameMapper The mapping between ECML URL parameter names and WebSphere Commerce URL parameter names. |
Constructor Summary | |
---|---|
TypedProperty() Creates the typed property object. | |
TypedProperty(java.util.Hashtable hTP) Creates a typed property object from the given hashtable. | |
TypedProperty(int initialCapacity) Creates the typed property object. | |
TypedProperty(int initialCapacity, float loadFactor) Creates the typed property object. |
Method Summary | |
---|---|
static
TypedProperty |
createTextResponse(java.lang.String textResponse) Deprecated. Use the static method of same name defined in AbtractDirectViewCommand. |
java.lang.Object |
get(java.lang.String key) Returns the value associated with the key specified. |
java.lang.Object |
get(java.lang.String key, java.lang.Object def) Returns the value associated with the specified key. |
java.lang.String[] |
getArray(java.lang.String key) Returns the value associated with the key as a String array object. |
java.lang.String[] |
getArray(java.lang.String key, java.lang.String[] def) Returns the value associated with the key as a String array. |
java.math.BigDecimal |
getBigDecimal(java.lang.String key) Returns the value associated with the key as a BigDecimal object. |
java.math.BigDecimal |
getBigDecimal(java.lang.String key,
java.math.BigDecimal def) Returns the value associated with the key as a BigDecimal object. |
boolean |
getBoolean(java.lang.String key) Returns the value associated with the key as a boolean value. |
boolean |
getBoolean(java.lang.String key, boolean def) Returns the value associated with the key as a boolean value. |
java.lang.Double |
getDouble(java.lang.String key) Returns the value associated with the key as a Double object. |
java.lang.Double |
getDouble(java.lang.String key, double def) Returns the value associated with the key as a Double object. |
java.lang.Double |
getDouble(java.lang.String key, java.lang.Double def) Returns the value associated with the key as a Double object. |
double |
getDoubleValue(java.lang.String key) Returns the value associated with the key as a double. |
double |
getDoubleValue(java.lang.String key, double def) Returns the value associated with the key as a double. |
java.lang.Float |
getFloat(java.lang.String key) Returns the value associated with the key as a Float object. |
java.lang.Float |
getFloat(java.lang.String key, float def) Returns the value associated with the key as a Float object. |
java.lang.Float |
getFloat(java.lang.String key, java.lang.Float def) Returns the value associated with the key as a Float object. |
float |
getFloatValue(java.lang.String key) Returns the value associated with the key as a type of float. |
float |
getFloatValue(java.lang.String key, float def) Returns the value associated with the key as a type of float. |
java.lang.Integer |
getInteger(java.lang.String key) Returns the value associated with the key as an Integer object. |
java.lang.Integer |
getInteger(java.lang.String key, int def) Returns the value associated with the key as an Integer object. |
java.lang.Integer |
getInteger(java.lang.String key, java.lang.Integer def) Returns the value associated with the key as an Integer object. |
java.lang.String |
getIntParamName(java.lang.String key) Returns the corresponding Electronic Commerce Modeling Language (ECML) version of the parameter name. |
int |
getIntValue(java.lang.String key) Returns the value associated with the key as an integer. |
int |
getIntValue(java.lang.String key, int def) Returns the value associated with the key as an integer. |
java.lang.Long |
getLong(java.lang.String key) Returns the value associated with the key as a Long object. |
java.lang.Long |
getLong(java.lang.String key, long def) Returns the value associated with the key as a Long object. |
java.lang.Long |
getLong(java.lang.String key, java.lang.Long def) Returns the value associated with the key as a Long object. |
java.lang.Long[] |
getLongArray(java.lang.String key) Returns the value associated with the key as a Long object array. |
java.lang.Long[] |
getLongArray(java.lang.String key, java.lang.Long[] def) Returns the value associated with the key as a Long object array. |
long |
getLongValue(java.lang.String key) Returns the value associated with the key as type long. |
long |
getLongValue(java.lang.String key, long def) Returns the value associated with the key as type long. |
java.lang.String |
getQueryString() Returns the query string representation of the parameters stored in the typed property object. |
java.lang.Short |
getShort(java.lang.String key) Returns the value associated with the key as a Short object. |
java.lang.Short |
getShort(java.lang.String key, short def) Returns the value associated with the key as a Short object. |
java.lang.Short |
getShort(java.lang.String key, java.lang.Short def) Returns the value associated with the key as a Short object. |
short |
getShortValue(java.lang.String key) Returns the value associated with the key as a short primitive. |
short |
getShortValue(java.lang.String key, short def) Returns the value associated with the key as a short primitive. |
java.lang.String |
getString(java.lang.String key) Returns the value associated with the key as a String object. |
java.lang.String |
getString(java.lang.String key, java.lang.String def) Returns the value associated with the key as a String object. |
java.lang.Object |
getUrlParam(java.lang.String key) Returns the value associated with the URL parameter name. |
java.lang.String |
getUrlParamName(java.lang.String key) Returns the parameter name of the parameter. |
static void |
initUrlParamNameMapper(UrlParamMapperFile mapper) Initializes the URL mapping file which maps the WebSphere Commerce server parameter names to the Electronic Commerce Modeling Language (ECML) version of the parameter names. |
void |
putUrlParam(java.lang.String key, java.lang.Object obj) Add a new property using the URL parameter name as a key. |
java.lang.String |
toProtectedString() Returns a string that represents that context of the current object. |
java.lang.String |
toString() Return a string that represents that information stored in the current object. |
Methods inherited from class java.util.Hashtable |
clear, clone, contains, containsKey, containsValue, elements,
entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash,
remove, size, values |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait,
wait |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
protected static UrlParamMapperFile urlMapperFile
protected java.util.Hashtable urlNameMapper
Constructor Detail |
---|
public TypedProperty()
public TypedProperty(int initialCapacity)
initialCapacity
- The number of objects that are stored in the
typed property.public TypedProperty(int initialCapacity, float loadFactor)
initialCapacity
- The number of objects that are stored in the
typed property.loadFactor
- The load factor to increase the size of the
number of elements to store.public TypedProperty(java.util.Hashtable hTP)
Method Detail |
---|
public static TypedProperty createTextResponse(java.lang.String textResponse)
textResponse
- The text to be returned.public java.lang.Object get(java.lang.String key) throws ParameterNotFoundException
key
- The key of the parameter to find.
ParameterNotFoundException
- if the parameter does not exist in the
typed property object.public java.lang.Object get(java.lang.String key, java.lang.Object def)
key
- The key of the parameter to find.public java.lang.String[] getArray(java.lang.String key) throws ParameterNotFoundException, InvalidParameterValueException
key
- The key of the parameter to find.
InvalidParameterValueException
- if the parameter is not an Array
object.
ParameterNotFoundException
- if the parameter is not found in the
typed property object.public java.lang.String[] getArray(java.lang.String key, java.lang.String[] def)
key
- The key of the parameter to find.public java.math.BigDecimal getBigDecimal(java.lang.String key) throws ParameterNotFoundException, InvalidParameterValueException
key
- The key of the parameter to find.
InvalidParameterValueException
- the value cannot be converted to a
BigDecimal.
ParameterNotFoundException
- the specified parameter does not
exist.public java.math.BigDecimal getBigDecimal(java.lang.String key, java.math.BigDecimal def)
key
- The key of the parameter to find.public boolean getBoolean(java.lang.String key) throws ParameterNotFoundException
key
- The key of the parameter to find.
ParameterNotFoundException
- if the parameter specified cannot be
found.public boolean getBoolean(java.lang.String key, boolean def)
key
- The key of the parameter to find.public java.lang.Double getDouble(java.lang.String key) throws ParameterNotFoundException, InvalidParameterValueException
key
- The key of the parameter to find.
InvalidParameterValueException
- if the value cannot be converted to
a Double object.
ParameterNotFoundException
- if the parameter cannot be
found.public java.lang.Double getDouble(java.lang.String key, double def)
key
- The key of the parameter to find.public java.lang.Double getDouble(java.lang.String key, java.lang.Double def)
key
- The key of the parameter to find.public double getDoubleValue(java.lang.String key) throws ParameterNotFoundException
key
- The key of the parameter to find.java.lang.NumberFormatException
- if the value cannot be
converted to a double.
ParameterNotFoundException
- if the parameter cannot be
found.public double getDoubleValue(java.lang.String key, double def)
key
- The key of the parameter to find.public java.lang.Float getFloat(java.lang.String key) throws ParameterNotFoundException, InvalidParameterValueException
key
- The key of the parameter to find.
InvalidParameterValueException
- if the value cannot be converted to
a Float object.
ParameterNotFoundException
- if the parameter cannot be
found.public java.lang.Float getFloat(java.lang.String key, float def)
key
- The key of the parameter to find.public java.lang.Float getFloat(java.lang.String key, java.lang.Float def)
key
- The key of the parameter to find.public float getFloatValue(java.lang.String key) throws ParameterNotFoundException, InvalidParameterValueException
key
- The key of the parameter to find.
InvalidParameterValueException
- if the value cannot be converted in
to float
ParameterNotFoundException
- if the parameter cannot be
found.public float getFloatValue(java.lang.String key, float def)
key
- The key of the parameter to find.public java.lang.Integer getInteger(java.lang.String key) throws ParameterNotFoundException, InvalidParameterValueException
key
- The key of the parameter to find.
InvalidParameterValueException
- if the value cannot be converted to
an Integer object.
ParameterNotFoundException
- if the parameter cannot be
found.public java.lang.Integer getInteger(java.lang.String key, int def)
key
- The key of the parameter to find.public java.lang.Integer getInteger(java.lang.String key, java.lang.Integer def)
key
- The key of the parameter to find.public java.lang.String getIntParamName(java.lang.String key)
key
- The parameter name.public int getIntValue(java.lang.String key) throws ParameterNotFoundException, InvalidParameterValueException
key
- The key of the parameter to find.
InvalidParameterValueException
- if the value cannot be converted to
an integer.
ParameterNotFoundException
- if the parameter cannot be
found.public int getIntValue(java.lang.String key, int def)
key
- The key of the parameter to find.public java.lang.Long getLong(java.lang.String key) throws ParameterNotFoundException, InvalidParameterValueException
key
- The key of the parameter to find.
InvalidParameterValueException
- if the value cannot be converted in
to a Long object.
ParameterNotFoundException
- if the parameter cannot be
found.public java.lang.Long getLong(java.lang.String key, long def)
key
- The key of the parameter to find.public java.lang.Long getLong(java.lang.String key, java.lang.Long def)
key
- The key of the parameter to find.public java.lang.Long[] getLongArray(java.lang.String key) throws ParameterNotFoundException, InvalidParameterValueException
key
- The key of the parameter to find.
InvalidParameterValueException
- if the value cannot be converted in
to a Long object array.
ParameterNotFoundException
- if the parameter cannot be
found.public java.lang.Long[] getLongArray(java.lang.String key, java.lang.Long[] def)
key
- The key of the parameter to find.public long getLongValue(java.lang.String key) throws ParameterNotFoundException, InvalidParameterValueException
key
- The key of the parameter to find.
InvalidParameterValueException
- if the value cannot be converted in
to long primitive.
ParameterNotFoundException
- if the parameter cannot be
found.public long getLongValue(java.lang.String key, long def)
key
- The key of the parameter to find.public java.lang.String getQueryString()
public java.lang.Short getShort(java.lang.String key) throws InvalidParameterValueException, ParameterNotFoundException
key
- The key of the parameter to find.
InvalidParameterValueException
- if the value cannot be converted in
to a Short object.
ParameterNotFoundException
- if the parameter cannot be
found.public java.lang.Short getShort(java.lang.String key, java.lang.Short def)
key
- The key of the parameter to find.public java.lang.Short getShort(java.lang.String key, short def)
key
- The key of the parameter to find.public short getShortValue(java.lang.String key) throws ParameterNotFoundException, InvalidParameterValueException
key
- The key of the parameter to find.
InvalidParameterValueException
- if the value cannot be converted in
to a short primitive.
ParameterNotFoundException
- if the parameter cannot be
found.public short getShortValue(java.lang.String key, short def)
key
- The key of the parameter to find.public java.lang.String getString(java.lang.String key) throws ParameterNotFoundException
key
- The key of the parameter to find.
ParameterNotFoundException
- if the parameter cannot be
found.public java.lang.String getString(java.lang.String key, java.lang.String def)
key
- The key of the parameter to find.public java.lang.Object getUrlParam(java.lang.String key)
key
- The URL parameter namepublic java.lang.String getUrlParamName(java.lang.String key)
key
- The parameter name.public static void initUrlParamNameMapper(UrlParamMapperFile mapper)
public void putUrlParam(java.lang.String key, java.lang.Object obj)
key
- The URL parameter name.obj
- the parameter value.public java.lang.String toProtectedString()
public java.lang.String toString()
toString
in class
java.util.Hashtable