fc.web.forms
Class VFilledOnFilled

java.lang.Object
  extended by fc.web.forms.FormValidator
      extended by fc.web.forms.VConditional
          extended by fc.web.forms.VFilledOnFilled

public abstract class VFilledOnFilled
extends VConditional

Validates that some condition/state for a group of fields implies some other condition/state for another group of fields. The pre/post conditions are both the result of validators attached to the pre/post fields.


Constructor Summary
VFilledOnFilled(Form f, String name, String errorMessage, VFilledGroup preValidator, VFilledGroup postValidator)
           
 
Method Summary
 boolean postConditionMet(FormData fd, javax.servlet.http.HttpServletRequest req)
          Subclasses should implement this method to check that certain post conditions have been met.
 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.
 
Methods inherited from class fc.web.forms.VConditional
validate
 
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

VFilledOnFilled

public VFilledOnFilled(Form f,
                       String name,
                       String errorMessage,
                       VFilledGroup preValidator,
                       VFilledGroup postValidator)
Parameters:
name - name for this validator
errorMessage - validation error message
preValidator - a pre condition validator
postValidator - a post condition validator
Method Detail

preConditionMet

public boolean preConditionMet(FormData fd,
                               javax.servlet.http.HttpServletRequest req)
Description copied from class: VConditional
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.

Specified by:
preConditionMet in class VConditional
Returns:
true if the pre-conditions have been met, false otherwise

postConditionMet

public boolean postConditionMet(FormData fd,
                                javax.servlet.http.HttpServletRequest req)
Description copied from class: VConditional
Subclasses should implement this method to check that certain post conditions have been met. This method will only be called if the VConditional.preConditionMet(fc.web.forms.FormData, javax.servlet.http.HttpServletRequest) method returns true.

Specified by:
postConditionMet in class VConditional
Returns:
true if the post-conditions have been met, false otherwise