|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
ValueParser is a base interface for classes that need to parse name/value Parameters, for example GET/POST data or Cookies (ParameterParser and CookieParser)
NOTE: The name= portion of a name=value pair may be converted to lowercase or uppercase when the object is initialized and when new data is added. This behaviour is determined by the url.case.folding property in TurbineResources.properties. Adding a name/value pair may overwrite existing name=value pairs if the names match:
| Field Summary | |
static String |
URL_CASE_FOLDING
The case folding property specifying the case folding to apply to value keys of the parser. |
static String |
URL_CASE_FOLDING_LOWER
|
static String |
URL_CASE_FOLDING_NONE
|
static String |
URL_CASE_FOLDING_UPPER
|
| Method Summary | |
void |
add(String name,
double value)
Add a name/value pair into this object. |
void |
add(String name,
int value)
Add a name/value pair into this object. |
void |
add(String name,
Integer value)
Add a name/value pair into this object. |
void |
add(String name,
long value)
Add a name/value pair into this object. |
void |
add(String name,
String value)
Add a name/value pair into this object. |
void |
append(String name,
String value)
Add a String parameters. |
void |
clear()
Clear all name/value pairs out of this object. |
boolean |
containsKey(Object key)
Determine whether a given key has been inserted. |
String |
convert(String value)
Trims the string data and applies the conversion specified in the property given by URL_CASE_FOLDING. |
String |
get(String name)
Return a String for the given name. |
BigDecimal |
getBigDecimal(String name)
Return a BigDecimal for the given name. |
BigDecimal |
getBigDecimal(String name,
BigDecimal defaultValue)
Return a BigDecimal for the given name. |
BigDecimal[] |
getBigDecimals(String name)
Return an array of BigDecimals for the given name. |
Boolean |
getBool(String name)
Return a Boolean for the given name. |
Boolean |
getBool(String name,
boolean defaultValue)
Return a Boolean for the given name. |
boolean |
getBoolean(String name)
Return a boolean for the given name. |
boolean |
getBoolean(String name,
boolean defaultValue)
Return a boolean for the given name. |
byte |
getByte(String name)
Return a byte for the given name. |
byte |
getByte(String name,
byte defaultValue)
Return a byte for the given name. |
byte[] |
getBytes(String name)
Return an array of bytes for the given name. |
String |
getCharacterEncoding()
Get the character encoding that will be used by this ValueParser. |
double |
getDouble(String name)
Return a double for the given name. |
double |
getDouble(String name,
double defaultValue)
Return a double for the given name. |
float |
getFloat(String name)
Return a float for the given name. |
float |
getFloat(String name,
float defaultValue)
Return a float for the given name. |
int |
getInt(String name)
Return an int for the given name. |
int |
getInt(String name,
int defaultValue)
Return an int for the given name. |
Integer |
getInteger(String name)
Return an Integer for the given name. |
Integer |
getInteger(String name,
int defaultValue)
Return an Integer for the given name. |
Integer |
getInteger(String name,
Integer def)
Return an Integer for the given name. |
Integer[] |
getIntegers(String name)
Return an array of Integers for the given name. |
int[] |
getInts(String name)
Return an array of ints for the given name. |
Object[] |
getKeys()
|
long |
getLong(String name)
Return a long for the given name. |
long |
getLong(String name,
long defaultValue)
Return a long for the given name. |
Long[] |
getLongObjects(String name)
Return an array of Longs for the given name. |
long[] |
getLongs(String name)
Return an array of longs for the given name. |
Object |
getObject(String name)
Return an Object for the given name. |
Object[] |
getObjects(String name)
Return an array of Objects for the given name. |
String |
getString(String name)
Return a String for the given name. |
String |
getString(String name,
String defaultValue)
Return a String for the given name. |
String[] |
getStrings(String name)
Return an array of Strings for the given name. |
String[] |
getStrings(String name,
String[] defaultValue)
Return an array of Strings for the given name. |
Enumeration |
keys()
|
Object |
remove(String name)
Removes the named parameter from the contained hashtable. |
void |
setCharacterEncoding(String s)
Set the character encoding that will be used by this ValueParser. |
void |
setProperties(Object bean)
Uses bean introspection to set writable properties of bean from the parameters, where a (case-insensitive) name match between the bean property and the parameter is looked for. |
void |
setString(String name,
String value)
Set a parameter to a specific value. |
void |
setStrings(String name,
String[] values)
Set a parameter to a specific value. |
String |
toString()
Simple method that attempts to get a toString() representation of this object. |
| Field Detail |
public static final String URL_CASE_FOLDING
public static final String URL_CASE_FOLDING_NONE
public static final String URL_CASE_FOLDING_LOWER
public static final String URL_CASE_FOLDING_UPPER
| Method Detail |
public void clear()
public void setCharacterEncoding(String s)
public String getCharacterEncoding()
public String convert(String value)
value - A String to be processed.
public void add(String name,
double value)
name - A String with the name.value - A double with the value.
public void add(String name,
int value)
name - A String with the name.value - An int with the value.
public void add(String name,
Integer value)
name - A String with the name.value - An Integer with the value.
public void add(String name,
long value)
name - A String with the name.value - A long with the value.
public void add(String name,
String value)
name - A String with the name.value - A long with the value.
public void append(String name,
String value)
name - A String with the name.value - A String with the value.public Object remove(String name)
Hashtable.remove().
String[])
or null if the key was not mapped.public boolean containsKey(Object key)
key - An Object with the key to search for.
public Enumeration keys()
public Object[] getKeys()
public boolean getBoolean(String name,
boolean defaultValue)
name - A String with the name.defaultValue - The default value.
public boolean getBoolean(String name)
name - A String with the name.
public Boolean getBool(String name,
boolean defaultValue)
name - A String with the name.defaultValue - The default value.
public Boolean getBool(String name)
name - A String with the name.
public double getDouble(String name,
double defaultValue)
name - A String with the name.defaultValue - The default value.
public double getDouble(String name)
name - A String with the name.
public float getFloat(String name,
float defaultValue)
name - A String with the name.defaultValue - The default value.
public float getFloat(String name)
name - A String with the name.
public BigDecimal getBigDecimal(String name,
BigDecimal defaultValue)
name - A String with the name.defaultValue - The default value.
public BigDecimal getBigDecimal(String name)
name - A String with the name.
public BigDecimal[] getBigDecimals(String name)
name - A String with the name.
public int getInt(String name,
int defaultValue)
name - A String with the name.defaultValue - The default value.
public int getInt(String name)
name - A String with the name.
public Integer getInteger(String name,
int defaultValue)
name - A String with the name.defaultValue - The default value.
public Integer getInteger(String name,
Integer def)
name - A String with the name.
public Integer getInteger(String name)
name - A String with the name.
public int[] getInts(String name)
name - A String with the name.
public Integer[] getIntegers(String name)
name - A String with the name.
public long getLong(String name,
long defaultValue)
name - A String with the name.defaultValue - The default value.
public long getLong(String name)
name - A String with the name.
public long[] getLongs(String name)
name - A String with the name.
public Long[] getLongObjects(String name)
name - A String with the name.
public byte getByte(String name,
byte defaultValue)
name - A String with the name.defaultValue - The default value.
public byte getByte(String name)
name - A String with the name.
public byte[] getBytes(String name)
throws UnsupportedEncodingException
name - A String with the name.
UnsupportedEncodingExceptionpublic String getString(String name)
name - A String with the name.
public String get(String name)
$data.Parameters.form_variable_name
name - A String with the name.
public String getString(String name,
String defaultValue)
name - A String with the name.defaultValue - The default value.
public void setString(String name,
String value)
name - The name of the parameter.value - The value to set.public String[] getStrings(String name)
name - A String with the name.
public String[] getStrings(String name,
String[] defaultValue)
name - A String with the name.defaultValue - The default value.
public void setStrings(String name,
String[] values)
name - The name of the parameter.values - The value to set.public Object getObject(String name)
name - A String with the name.
public Object[] getObjects(String name)
name - A String with the name.
public void setProperties(Object bean)
throws Exception
bean - An Object.
Exception, - a generic exception.
Exceptionpublic String toString()
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||