Class VConditional
java.lang.Object
fc.web.forms.FormValidator
fc.web.forms.VConditional
- Direct Known Subclasses:
VFilledOnChoice, VFilledOnFilled
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(FormData, HttpServletRequest)
and postConditionMet(FormData, HttpServletRequest)
. If the pre condition is true, the post condition must
also be true. Subclasses should implement both methods as appropriate.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
postConditionMet
(FormData fd, jakarta.servlet.http.HttpServletRequest req) Subclasses should implement this method to check that certain post conditions have been met.abstract boolean
preConditionMet
(FormData fd, jakarta.servlet.http.HttpServletRequest req) Subclasses should implement this method to check that certain fields or pre-conditions have been met.boolean
Returns the value returned bypostConditionMet(FormData, HttpServletRequest)
if the pre conditions were met.Methods inherited from class FormValidator
getErrorMessage, getName, setErrorMessage, toString
-
Constructor Details
-
VConditional
-
-
Method Details
-
validate
Returns the value returned bypostConditionMet(FormData, HttpServletRequest)
if the pre conditions were met. (preConditionMet(FormData, HttpServletRequest)
returned true). If the pre condition was not met, there is no need for further validation and this method will return true.- Specified by:
validate
in classFormValidator
- Returns:
- true is validation succeeded, false otherwise
-
preConditionMet
Subclasses should implement this method to check that certain fields or pre-conditions have been met. Only gf these conditions have been met will there be a check to see that the post conditions are also true.- Returns:
- true if the pre-conditions have been met, false otherwise
-
postConditionMet
Subclasses should implement this method to check that certain post conditions have been met. This method will only be called if thepreConditionMet(FormData, HttpServletRequest)
method returns true.- Returns:
- true if the post-conditions have been met, false otherwise
-