|
HDIV API 2.0.4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hdiv.filter.AbstractValidatorHelper
public abstract class AbstractValidatorHelper
It validates client requests by comsuming an object of type IState and validating all the entry data, besides replacing relative values by its real values.
| Constructor Summary | |
|---|---|
AbstractValidatorHelper()
|
|
| Method Summary | |
|---|---|
abstract void |
endPage()
Handle the storing of HDIV's state, which is done after action invocation. |
org.springframework.beans.factory.BeanFactory |
getBeanFactory()
|
IDataValidator |
getDataValidator()
|
HDIVConfig |
getHdivConfig()
|
Logger |
getLogger()
|
javax.servlet.http.HttpServletRequest |
getRequest()
|
RequestWrapper |
getRequestWrapper()
|
StateUtil |
getStateUtil()
|
java.lang.String |
getTarget()
|
void |
init(javax.servlet.http.HttpServletRequest request)
Initialization of the objects needed for the validation process. |
void |
initTesting()
Testing objects initilization. |
boolean |
isTheSameAction()
Checks if the action received in the request is the same as the one stored in the HDIV state. |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance. |
void |
setDataValidator(IDataValidator dataValidator)
|
void |
setHdivConfig(HDIVConfig hdivConfig)
|
void |
setLogger(Logger logger)
|
void |
setRequest(javax.servlet.http.HttpServletRequest request)
|
void |
setRequestWrapper(RequestWrapper requestWrapper)
|
void |
setStateUtil(StateUtil stateUtil)
|
void |
setTarget(java.lang.String target)
|
void |
setTargetWithoutContextPath(java.lang.String targetWithoutContextPath)
|
abstract void |
startPage()
It is called in the pre-processing stage of each user request. |
boolean |
validate()
Checks if the values of the parameters received in the request request are valid. |
void |
validateEditableParameter(java.lang.String parameter,
java.lang.String[] values,
java.lang.String dataType,
java.util.Hashtable unauthorizedParameters)
Checks if the values values are valid for the editable
parameter parameter. |
boolean |
validateHDIVSuffix(java.lang.String value)
Checks if the suffix added in the memory version to all requests in the HDIV parameter is the same as the one stored in session, which is the original suffix. |
boolean |
validateRequestCookies(javax.servlet.http.Cookie[] requestCookies)
Checks if the cookies received in the request are correct. |
boolean |
validateStartPageParameters()
It validates the parameters of an init page because our application can receive requests that require validation but don't have any HDIV state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractValidatorHelper()
| Method Detail |
|---|
public void init(javax.servlet.http.HttpServletRequest request)
init in interface IValidationHelperrequest - HTTP servlet request
HDIVException - if there is an initialization error.public void initTesting()
public boolean validate()
request are valid. These values are valid if and only if
the noneditable parameters havenīt been modified.
validate in interface IValidationHelperrequest pass the the HDIV validation. False,
otherwise.
HDIVException - If the request doesn't pass the HDIV validation an
exception is thrown explaining the cause of the error.public boolean isTheSameAction()
public boolean validateStartPageParameters()
public boolean validateRequestCookies(javax.servlet.http.Cookie[] requestCookies)
requestCookies - cookies received in the request
public void validateEditableParameter(java.lang.String parameter,
java.lang.String[] values,
java.lang.String dataType,
java.util.Hashtable unauthorizedParameters)
values are valid for the editable
parameter parameter. This validation is defined by the
user in the hdiv-validations.xml file of Spring. If the values are not
valid, an error message with the parameter and the received values will
be log.
parameter - parameter namevalues - parameter's valuesdataType - editable data typeunauthorizedParameters - Unauthorized editable parameterspublic boolean validateHDIVSuffix(java.lang.String value)
value - value received in the HDIV parameter
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAwarebeanFactory - owning BeanFactory (may not be null). The bean can
immediately call methods on the factory.public org.springframework.beans.factory.BeanFactory getBeanFactory()
public IDataValidator getDataValidator()
public void setDataValidator(IDataValidator dataValidator)
dataValidator - The data validator to set.public javax.servlet.http.HttpServletRequest getRequest()
public void setRequest(javax.servlet.http.HttpServletRequest request)
request - The request to set.public java.lang.String getTarget()
getTarget in interface IValidationHelperpublic void setTarget(java.lang.String target)
setTarget in interface IValidationHelpertarget - The target to set.public void setTargetWithoutContextPath(java.lang.String targetWithoutContextPath)
setTargetWithoutContextPath in interface IValidationHelpertargetWithoutContextPath - The target without context path to set.public RequestWrapper getRequestWrapper()
getRequestWrapper in interface IValidationHelperpublic Logger getLogger()
public void setLogger(Logger logger)
logger - The user logger to set.public StateUtil getStateUtil()
public void setStateUtil(StateUtil stateUtil)
stateUtil - The state utility to set.public HDIVConfig getHdivConfig()
public void setHdivConfig(HDIVConfig hdivConfig)
setHdivConfig in interface IValidationHelperhdivConfig - The HDIV configuration object to set.public void setRequestWrapper(RequestWrapper requestWrapper)
setRequestWrapper in interface IValidationHelperrequest - The request to set. Only for testingpublic abstract void startPage()
startPage in interface IValidationHelperpublic abstract void endPage()
endPage in interface IValidationHelperrequest - http request
java.lang.Exception - if there is an error in storing process.
|
HDIV 2.0.4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||