|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ValueParser
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 |
DEFAULT_CHARACTER_ENCODING
The default character encoding to use when converting to byte arrays |
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 |
add(String name,
String[] value)
Add an array of Strings for a key. |
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 |
convertAndTrim(String value)
Convert a String value according to the url-case-folding property. |
String |
convertAndTrim(String value,
int folding)
A static version of the convert method, which 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 |
getBoolean(String name)
Return a boolean for the given name. |
boolean |
getBoolean(String name,
boolean defaultValue)
Return a boolean for the given name. |
Boolean |
getBooleanObject(String name)
Returns a Boolean object for the given name. |
Boolean |
getBooleanObject(String name,
Boolean defaultValue)
Returns a Boolean object for the given name. |
Boolean[] |
getBooleanObjects(String name)
Return an array of Booleans for the given name. |
boolean[] |
getBooleans(String name)
Return an array of booleans 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 |
getByteObject(String name)
Return a byte for the given name. |
Byte |
getByteObject(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. |
Date |
getDate(String name)
Returns a java.util.Date object. |
Date |
getDate(String name,
DateFormat df)
Returns a java.util.Date object. |
Date |
getDate(String name,
DateFormat df,
Date defaultValue)
Returns a java.util.Date object. |
DateFormat |
getDateFormat()
Get the date format 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. |
Double |
getDoubleObject(String name)
Return a Double for the given name. |
Double |
getDoubleObject(String name,
Double defaultValue)
Return a Double for the given name. |
Double[] |
getDoubleObjects(String name)
Return an array of doubles for the given name. |
double[] |
getDoubles(String name)
Return an array of doubles 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. |
Float |
getFloatObject(String name)
Return a float for the given name. |
Float |
getFloatObject(String name,
Float defaultValue)
Return a Float for the given name. |
Float[] |
getFloatObjects(String name)
Return an array of floats for the given name. |
float[] |
getFloats(String name)
Return an array of floats 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 |
getIntObject(String name)
Return an Integer for the given name. |
Integer |
getIntObject(String name,
Integer defaultValue)
Return an Integer for the given name. |
Integer[] |
getIntObjects(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()
Returns all the available parameter names. |
Locale |
getLocale()
Get the locale that will be used by this ValueParser. |
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 |
getLongObject(String name)
Return a Long for the given name. |
Long |
getLongObject(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. |
NumberFormat |
getNumberFormat()
Get the number format that will be used by this ValueParser. |
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. |
int |
getUrlFolding()
Gets the folding value from the ParserService configuration |
Set |
keySet()
Gets the 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 |
setDateFormat(DateFormat df)
Set the date format that will be used by this ValueParser. |
void |
setLocale(Locale l)
Set the locale that will be used by this ValueParser. |
void |
setNumberFormat(NumberFormat nf)
Set the number format 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 |
---|
static final String DEFAULT_CHARACTER_ENCODING
Method Detail |
---|
void clear()
void setCharacterEncoding(String s)
String getCharacterEncoding()
void setLocale(Locale l)
Locale getLocale()
void setDateFormat(DateFormat df)
DateFormat getDateFormat()
void setNumberFormat(NumberFormat nf)
NumberFormat getNumberFormat()
String convert(String value)
value
- A String to be processed.
void add(String name, double value)
name
- A String with the name.value
- A double with the value.void add(String name, int value)
name
- A String with the name.value
- An int with the value.void add(String name, Integer value)
name
- A String with the name.value
- An Integer with the value.void add(String name, long value)
name
- A String with the name.value
- A long with the value.void add(String name, String value)
name
- A String with the name.value
- A long with the value.void add(String name, String[] value)
name
- A String with the name.value
- A String Array.Object remove(String name)
Hashtable.remove()
.
String[]
)
or null
if the key was not mapped.boolean containsKey(Object key)
key
- An Object with the key to search for.
Set keySet()
Set
of the keys.Object[] getKeys()
boolean getBoolean(String name, boolean defaultValue)
name
- A String with the name.defaultValue
- The default value.
boolean getBoolean(String name)
name
- A String with the name.
Boolean getBooleanObject(String name)
Valid values for true: true, on, 1, yes
Valid values for false: false, off, 0, no
The string is compared without reguard to case.
name
- A String with the name.
Boolean getBooleanObject(String name, Boolean defaultValue)
Valid values for true: true, on, 1, yes
Valid values for false: false, off, 0, no
The string is compared without reguard to case.
name
- A String with the name.
boolean[] getBooleans(String name)
name
- A String with the name.
Boolean[] getBooleanObjects(String name)
name
- A String with the name.
double getDouble(String name, double defaultValue)
name
- A String with the name.defaultValue
- The default value.
double getDouble(String name)
name
- A String with the name.
double[] getDoubles(String name)
name
- A String with the name.
Double getDoubleObject(String name, Double defaultValue)
name
- A String with the name.defaultValue
- The default value.
Double getDoubleObject(String name)
name
- A String with the name.
Double[] getDoubleObjects(String name)
name
- A String with the name.
float getFloat(String name, float defaultValue)
name
- A String with the name.defaultValue
- The default value.
float getFloat(String name)
name
- A String with the name.
float[] getFloats(String name)
name
- A String with the name.
Float getFloatObject(String name, Float defaultValue)
name
- A String with the name.defaultValue
- The default value.
Float getFloatObject(String name)
name
- A String with the name.
Float[] getFloatObjects(String name)
name
- A String with the name.
BigDecimal getBigDecimal(String name, BigDecimal defaultValue)
name
- A String with the name.defaultValue
- The default value.
BigDecimal getBigDecimal(String name)
null
.
name
- A String with the name.
BigDecimal[] getBigDecimals(String name)
name
- A String with the name.
int getInt(String name, int defaultValue)
name
- A String with the name.defaultValue
- The default value.
int getInt(String name)
name
- A String with the name.
Integer getIntObject(String name, Integer defaultValue)
name
- A String with the name.defaultValue
- The default value.
Integer getIntObject(String name)
name
- A String with the name.
int[] getInts(String name)
name
- A String with the name.
Integer[] getIntObjects(String name)
name
- A String with the name.
long getLong(String name, long defaultValue)
name
- A String with the name.defaultValue
- The default value.
long getLong(String name)
name
- A String with the name.
Long getLongObject(String name, Long defaultValue)
name
- A String with the name.defaultValue
- The default value.
Long getLongObject(String name)
name
- A String with the name.
long[] getLongs(String name)
name
- A String with the name.
Long[] getLongObjects(String name)
name
- A String with the name.
byte getByte(String name, byte defaultValue)
name
- A String with the name.defaultValue
- The default value.
byte getByte(String name)
name
- A String with the name.
byte[] getBytes(String name) throws UnsupportedEncodingException
name
- A String with the name.
UnsupportedEncodingException
Byte getByteObject(String name, Byte defaultValue)
name
- A String with the name.defaultValue
- The default value.
Byte getByteObject(String name)
name
- A String with the name.
String getString(String name)
name
- A String with the name.
String get(String name)
$data.Parameters.form_variable_name
name
- A String with the name.
String getString(String name, String defaultValue)
name
- A String with the name.defaultValue
- The default value.
void setString(String name, String value)
name
- The name of the parameter.value
- The value to set.String[] getStrings(String name)
name
- A String with the name.
String[] getStrings(String name, String[] defaultValue)
name
- A String with the name.defaultValue
- The default value.
void setStrings(String name, String[] values)
name
- The name of the parameter.values
- The value to set.Object getObject(String name)
name
- A String with the name.
Object[] getObjects(String name)
name
- A String with the name.
Date getDate(String name, DateFormat df, Date defaultValue)
name
- A String with the name.df
- A DateFormat.defaultValue
- The default value.
Date getDate(String name)
name
- A String with the name.
Date getDate(String name, DateFormat df)
name
- A String with the name.df
- A DateFormat.
void setProperties(Object bean) throws Exception
bean
- An Object.
Exception
- a generic exception.String toString()
toString
in class Object
String convertAndTrim(String value)
value
- the String to convert
String convertAndTrim(String value, int folding)
value
- A String to be processed.
int getUrlFolding()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |