|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfc.web.forms.FormValidator
fc.web.forms.VConditional
public abstract class VConditional
Validates that certain conditions in one or more fields in the form require other conditions of some other fields in that form.
Since the pre/post conditions can be arbitrary, this class defines
abstract methods called preConditionMet(fc.web.forms.FormData, javax.servlet.http.HttpServletRequest)
and postConditionMet(fc.web.forms.FormData, javax.servlet.http.HttpServletRequest)
. If the pre condition is true, the post condition must
also be true. Subclasses should implement both methods as appropriate.
Constructor Summary | |
---|---|
VConditional(Form f,
java.lang.String name,
java.lang.String errorMessage)
|
Method Summary | |
---|---|
abstract boolean |
postConditionMet(FormData fd,
javax.servlet.http.HttpServletRequest req)
Subclasses should implement this method to check that certain post conditions have been met. |
abstract boolean |
preConditionMet(FormData fd,
javax.servlet.http.HttpServletRequest req)
Subclasses should implement this method to check that certain fields or pre-conditions have been met. |
boolean |
validate(FormData fd,
javax.servlet.http.HttpServletRequest req)
Returns the value returned by postConditionMet(fc.web.forms.FormData, javax.servlet.http.HttpServletRequest)
if the pre conditions were met. |
Methods inherited from class fc.web.forms.FormValidator |
---|
getErrorMessage, getName, setErrorMessage, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public VConditional(Form f, java.lang.String name, java.lang.String errorMessage)
Method Detail |
---|
public boolean validate(FormData fd, javax.servlet.http.HttpServletRequest req)
postConditionMet(fc.web.forms.FormData, javax.servlet.http.HttpServletRequest)
if the pre conditions were met. (preConditionMet(fc.web.forms.FormData, javax.servlet.http.HttpServletRequest)
returned true). If the pre condition was
not met, there is no need for further validation and
this method will return true.
validate
in class FormValidator
public abstract boolean preConditionMet(FormData fd, javax.servlet.http.HttpServletRequest req)
public abstract boolean postConditionMet(FormData fd, javax.servlet.http.HttpServletRequest req)
preConditionMet(fc.web.forms.FormData, javax.servlet.http.HttpServletRequest)
method
returns true.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |