|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Input
Defines the behavior of an action input. An Input has parameters and headers. Parameters can be any java object, and not only strings. Headers can be only strings. Parameters are not read-only, and actions and filters can modify it, if they need to. Headers are read-only.
| Method Summary | ||
|---|---|---|
boolean |
getBoolean(String name)
|
|
boolean |
getBoolean(String name,
boolean def)
|
|
boolean |
getBooleanValue(String name)
Deprecated. use getBoolean instead |
|
boolean |
getBooleanValue(String name,
boolean def)
Deprecated. use getBoolean instead |
|
Date |
getDate(String name)
Parse a parameter value from this input as a Date. |
|
Date |
getDate(String name,
int style)
Parse a parameter value from this action input as a Date using the given style. |
|
Date |
getDate(String name,
String pattern)
Parse a parameter value from this action input as a Date using the given pattern. |
|
double |
getDouble(String name)
|
|
double |
getDouble(String name,
double def)
|
|
double |
getDoubleValue(String name)
Deprecated. use getDouble instead |
|
double |
getDoubleValue(String name,
double def)
Deprecated. use getDouble instead |
|
|
getEnum(String name,
Class<E> enumClass)
Convert the parameter value from this action input as an Enum. |
|
|
getEnums(String name,
Class<E> enumClass)
Convert the parameter value from this action input as an Array of Enums. |
|
float |
getFloat(String name)
|
|
float |
getFloat(String name,
float def)
|
|
float |
getFloatValue(String name)
Deprecated. use getFloat instead |
|
float |
getFloatValue(String name,
float def)
Deprecated. use getFloat instead |
|
String |
getHeader(String name)
Gets a header value from this input. |
|
Iterator<String> |
getHeaderKeys()
Gets an iterator with all header names. |
|
int |
getInt(String name)
|
|
int |
getInt(String name,
int def)
|
|
int[] |
getInts(String name)
|
|
int |
getIntValue(String name)
Deprecated. Use getInt instead |
|
int |
getIntValue(String name,
int def)
Deprecated. use getInt instead |
|
int[] |
getIntValues(String name)
Deprecated. Use getInts instead. |
|
long |
getLong(String name)
|
|
long |
getLong(String name,
long def)
|
|
long[] |
getLongs(String name)
Gets all parameter values with the given name as an long array. |
|
long |
getLongValue(String name)
Deprecated. getLong instead |
|
long |
getLongValue(String name,
long def)
Deprecated. getLong instead |
|
|
getObject(Class<? extends E> klass)
Gets a populated object with the values from the action input. |
|
|
getObject(Class<? extends E> klass,
String prefix)
Gets a populated object with the values from the action input. |
|
String |
getProperty(String name)
Gets a property associated with this input. |
|
String |
getString(String name)
|
|
String[] |
getStrings(String name)
|
|
String |
getStringValue(String name)
Deprecated. Use getString instead |
|
String[] |
getStringValues(String name)
Deprecated. Use getStrings instead |
|
Object |
getValue(String name)
Gets a parameter value (any object) with the given name. |
|
boolean |
has(String key)
Check if the input has this key (Shorter verions of hasValue) |
|
boolean |
hasValue(String name)
Checks if a value exists. |
|
void |
inject(Object bean)
Populates (inject properties) the bean with the values from the input. |
|
void |
inject(Object bean,
String prefix)
Populates (inject properties) the bean with the values from the input. |
|
Iterator<String> |
keys()
Gets an iterator with all the parameter names. |
|
void |
removeValue(String name)
Removes a parameter from this input. |
|
void |
setValue(String name,
Object value)
Sets a parameter value with the given name. |
|
| Method Detail |
|---|
String getHeader(String name)
name - the header name
Iterator<String> getHeaderKeys()
boolean hasValue(String name)
name - The name of the key.
boolean has(String key)
key - String getProperty(String name)
name - the name of the property
String getStringValue(String name)
name - the parameter's name
String getString(String name)
int getIntValue(String name)
name - the parameter's name
NullPointerException - if the value does not exist.
InputException - is the value cannot be converted to an int.int getInt(String name)
String[] getStringValues(String name)
name - the parameters'name
String[] getStrings(String name)
int[] getIntValues(String name)
name - the parameters'name
InputException - if any of the values cannot be converted to an int.int[] getInts(String name)
void setValue(String name,
Object value)
name - the name of the parametervalue - the parameter value (any object)Object getValue(String name)
name - the name of the parameter
void removeValue(String name)
name - the name of the parameter to remove.Iterator<String> keys()
int getIntValue(String name,
int def)
name - the parameter's namedef - default value to return
InputException - is the value cannot be converted to an int.
int getInt(String name,
int def)
long getLongValue(String name)
name - the parameter's name
NullPointerException - if the value does not exist.
InputException - is the value cannot be converted to a longlong getLong(String name)
long[] getLongs(String name)
name - the parameters'name
InputException - if any of the values cannot be converted to an long.
long getLongValue(String name,
long def)
name - the parameter's namedef - default value to return
InputException - is the value cannot be converted to a long.
long getLong(String name,
long def)
boolean getBooleanValue(String name)
name - the parameter's name
NullPointerException - if the value does not exist.
InputException - is the value cannot be converted to a boolean.boolean getBoolean(String name)
boolean getBooleanValue(String name,
boolean def)
name - the parameter's namedef - default value to return
InputException - is the value cannot be converted to a boolean.
boolean getBoolean(String name,
boolean def)
float getFloatValue(String name)
name - the parameter's name
NullPointerException - if the value does not exist.
InputException - is the value cannot be converted to a float.float getFloat(String name)
float getFloatValue(String name,
float def)
name - the parameter's namedef - default value to return
InputException - is the value cannot be converted to a float.
float getFloat(String name,
float def)
double getDoubleValue(String name)
name - the parameter's name
NullPointerException - if the value does not exist.
InputException - is the value cannot be converted to a doubledouble getDouble(String name)
double getDoubleValue(String name,
double def)
name - the parameter's namedef - default value to return
InputException - is the value cannot be converted to a double.
double getDouble(String name,
double def)
<E> E getObject(Class<? extends E> klass)
klass -
void inject(Object bean)
bean -
<E> E getObject(Class<? extends E> klass,
String prefix)
klass - prefix -
void inject(Object bean,
String prefix)
bean - prefix - Date getDate(String name)
name - the parameter's name
InputException - throws if the attributte can't be parsed
Date getDate(String name,
int style)
name - the parameter's namestyle - the DateFormat style to be used
InputException - throws if the attributte can't be parsed
Date getDate(String name,
String pattern)
name - the parameter's namepattern - The SimpleDateFormat pattern to be used
InputException - throws if the attributte can't be parsed
<E extends Enum<E>> E getEnum(String name,
Class<E> enumClass)
name - the parameter's nameenumClass - the Enum's class
<E extends Enum<E>> Set<E> getEnums(String name,
Class<E> enumClass)
name - the parameter's nameenumClass - the Enum's class
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||