nl.openedge.baritus
Class DefaultValidatorDelegate

java.lang.Object
  extended bynl.openedge.baritus.DefaultValidatorDelegate
All Implemented Interfaces:
nl.openedge.baritus.ValidatorDelegate

public final class DefaultValidatorDelegate
extends java.lang.Object
implements nl.openedge.baritus.ValidatorDelegate

Author:
Eelco Hillenius

Constructor Summary
DefaultValidatorDelegate(ValidatorRegistry validatorRegistry, FormBeanCtrlBase ctrl)
          construct with validator registry and instance of ctrl
 
Method Summary
 boolean doValidation(org.infohazard.maverick.flow.ControllerContext cctx, FormBeanContext formBeanContext, ExecutionParams execParams, java.util.Map parameters, boolean succeeded)
          handle the validation for all provided parameters.
static char[] getBREAKSYMBOLS()
           
static void setBREAKSYMBOLS(char[] cs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultValidatorDelegate

public DefaultValidatorDelegate(ValidatorRegistry validatorRegistry,
                                FormBeanCtrlBase ctrl)
construct with validator registry and instance of ctrl

Parameters:
validatorRegistry -
ctrl -
Method Detail

doValidation

public boolean doValidation(org.infohazard.maverick.flow.ControllerContext cctx,
                            FormBeanContext formBeanContext,
                            ExecutionParams execParams,
                            java.util.Map parameters,
                            boolean succeeded)
Description copied from interface: nl.openedge.baritus.ValidatorDelegate
handle the validation for all provided parameters. The parameters consist typically of the request parameters, possibly (depending on the also provided instance of ExecutionParams) with the addition of Maverick configuration parameters, session attributes and request attributes. Implementers should take care to only use the fields stored in parameters and not to get the field directly from e.g. the http request. The populated form is stored in the formBeanContext. If implementors have validation errors, they should store the error messages in the instance of FormBeanContext (using method(s) setError/ setErrors), and they should save the original input values (as stored in Map parameters) as override values in the formBeanContext (using method(s) setOverrideField)

Specified by:
doValidation in interface nl.openedge.baritus.ValidatorDelegate
Parameters:
cctx - controller context
formBeanContext - form bean context with populated bean
execParams - execution parameters
parameters - the map in which the requested values are stored. This map has at least the request parameters stored and depending on the execution parameters the maverick configuration parameters, session attributes and request attributes.
succeeded - whether population/ validation succeeded so far (did not generate any errors).
Returns:
whether validation passed NOTE: implementors should take note that it is possible that population/ validation allready failed before this method is called (in that case succeeded is false). If you do not want to override the errors (what is probably is good idea), you can check the current error map or overwrite value map in the formBeanContext. This allways works for properties that failed to populate, though it might not work for failed validations as that depends on the registrations that the individual validators make in the error map.
See Also:
ValidatorDelegate.doValidation(org.infohazard.maverick.flow.ControllerContext, nl.openedge.baritus.FormBeanContext, nl.openedge.baritus.ExecutionParams, java.util.Map, boolean)

getBREAKSYMBOLS

public static char[] getBREAKSYMBOLS()
Returns:
char[]

setBREAKSYMBOLS

public static void setBREAKSYMBOLS(char[] cs)
Parameters:
cs -


Copyright © 2003-2004 Open Edge. All Rights Reserved.