|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectau.com.whitesquare.waf.command.ValidatedCommand
This is the base implementation of BaseCommand, it is the most advanced command
that can be used by sub-classes, it supports all types of parameter parsing
context management and the sorts.
Last Modified $Date: 2006/08/09 22:17:24 $
| Field Summary | |
protected WAFRequest |
params
|
| Constructor Summary | |
ValidatedCommand()
|
|
| Method Summary | |
protected void |
addParamRetriever(ParameterRetriever retriever)
Queues in a parameter retreiver to this command. |
protected void |
addPostParseParameter(String code,
int paramType,
boolean mandatory,
String description)
|
protected void |
addPostParseParamRetriever(ParameterRetriever retriever)
Deprecated. Parameter retrivers can now have their own post parse parameters, add the param retreiver in the constructor and it will automatically get its post parse params loaded. |
protected void |
addRequestParameter(String code,
int paramType)
An overloaded version of the addRequestParameter method that defines the parameter as optional. |
protected void |
addRequestParameter(String code,
int paramType,
boolean mandatory,
String description)
Defines a parameter to be retreived from the request and mapped to a data type. |
protected void |
addSubCommandParameter(String key,
Object value)
|
void |
clearParameter(String key)
|
void |
clearParameters()
|
Response |
execute(WAFRequest theParams)
This is the method that is called to execute the actual work for the command. |
Boolean |
getBoolean(String code)
|
String |
getContext(int i)
Returns the name of a specific context element |
int |
getContextCount()
Returns the numeber of context elements found. |
Float |
getFloat(String code)
|
Float[] |
getFloatArray(String code)
|
Integer |
getInteger(String code)
|
Integer[] |
getIntegerArray(String code)
|
Long |
getLong(String code)
|
Long[] |
getLongArray(String code)
|
Object |
getObject(String code)
|
HttpServletRequest |
getRequest()
Allows the command to access data directly from the HttpServletRequest |
HttpServletResponse |
getResponse()
Allows the command to access data directory from the HttpServletResponse. |
HttpSession |
getSession()
|
String |
getString(String code)
|
String[] |
getStringArray(String code)
|
protected abstract Response |
innerExecute()
|
protected abstract Response |
parameterErrorExecute(ParameterErrors pe)
|
protected Response |
processSubCommand(BaseCommand command)
|
Response |
processSubCommand(BaseCommand command,
String message)
|
protected void |
setupPostParseFields()
This function is executed after the first set of parameters are processed. |
protected void |
setupPreParseFields()
This function is executed before the parameters values are processed. |
protected ParameterErrors |
validate()
This method supports post parameter check validation. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface au.com.whitesquare.waf.command.BaseCommand |
isSessionRequired |
| Field Detail |
protected WAFRequest params
| Constructor Detail |
public ValidatedCommand()
| Method Detail |
protected final void addRequestParameter(String code,
int paramType)
code - The data input field name/code to be parsedparamType - A RequestParameter constant (INTEGER, STRING, etc..) to determine the fields datatype.
protected final void addRequestParameter(String code,
int paramType,
boolean mandatory,
String description)
code - The data input field name/code to be parsedparamType - A RequestParameter constant (INTEGER, STRING, etc..) to determine the fields datatype.mandatory - To flag that the parameter is requireddescription - The human readable name of the field.
protected final void addPostParseParameter(String code,
int paramType,
boolean mandatory,
String description)
protected final void addParamRetriever(ParameterRetriever retriever)
retriever - the retreiver to add to the command.protected final void addPostParseParamRetriever(ParameterRetriever retriever)
retriever - public final HttpSession getSession()
public final void clearParameter(String key)
public final void clearParameters()
public String getString(String code)
public String[] getStringArray(String code)
public Long getLong(String code)
public Long[] getLongArray(String code)
public Float getFloat(String code)
public Float[] getFloatArray(String code)
public Integer getInteger(String code)
public Integer[] getIntegerArray(String code)
public Boolean getBoolean(String code)
public Object getObject(String code)
protected void setupPostParseFields()
protected void setupPreParseFields()
public final Response execute(WAFRequest theParams)
BaseCommand
execute in interface BaseCommandtheParams - is the WAFRequest object that contains all of the request
information parsed into the standard WAF format.
protected ParameterErrors validate()
ParameterErrors containing
the errors that have occured and then parameterErrorExecute
will be called.ParameterErrors collection by calling
super.validate().
protected abstract Response innerExecute()
protected abstract Response parameterErrorExecute(ParameterErrors pe)
protected final Response processSubCommand(BaseCommand command)
public final Response processSubCommand(BaseCommand command,
String message)
protected final void addSubCommandParameter(String key,
Object value)
public HttpServletRequest getRequest()
public HttpServletResponse getResponse()
public String getContext(int i)
i - the index of the context to return.
public int getContextCount()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||