org.iscreen.ognl
Class OgnlValidationServiceValidator

java.lang.Object
  extended by org.iscreen.impl.ValidationServiceValidator
      extended by org.iscreen.ognl.OgnlValidationServiceValidator
All Implemented Interfaces:
ValidatorWrapper

public class OgnlValidationServiceValidator
extends ValidationServiceValidator

This is the OGNL-specific validator that handles forwarding from one validation set to another.

Author:
Shellman, Dan

Field Summary
static java.lang.String DEFAULT_MAP
           
 
Fields inherited from class org.iscreen.impl.ValidationServiceValidator
failFastFlag, ifExp, iterateExp, mapExp, name, parentService, wrappedService
 
Constructor Summary
OgnlValidationServiceValidator(DefaultValidationService service, ValidationService theParentService)
          Default constructor.
 
Method Summary
protected  java.lang.Object mapObject(InternalValidatorContext context, ContextBean contextBean, java.lang.Object obj)
          Handle the mapping of the object being validated to the property that will be validated (may be the object, itself).
 void setMapExpression(java.lang.String exp)
           
protected  boolean shouldExecute(InternalValidatorContext context, ContextBean root, java.lang.Object obj)
          Determines whether the inclusion/call to the validation set should occur.
protected  boolean shouldIterate(InternalValidatorContext context, ContextBean root, java.lang.Object obj)
          Determines whether we're iterating over the mapped object.
 
Methods inherited from class org.iscreen.impl.ValidationServiceValidator
createNewContext, getDoc, getIfExpression, getIterateExpression, getMapExpression, getName, isFailFast, setFailFast, setIfExpression, setIterateExpression, setName, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAP

public static final java.lang.String DEFAULT_MAP
See Also:
Constant Field Values
Constructor Detail

OgnlValidationServiceValidator

public OgnlValidationServiceValidator(DefaultValidationService service,
                                      ValidationService theParentService)
Default constructor.

Parameters:
service - The validation service this validator represents
theParentService - The parent validation service
Method Detail

shouldIterate

protected boolean shouldIterate(InternalValidatorContext context,
                                ContextBean root,
                                java.lang.Object obj)
Determines whether we're iterating over the mapped object.

Specified by:
shouldIterate in class ValidationServiceValidator
Parameters:
context - The ValidatorContext
root - The ContextBean
obj - The object being validated.
Returns:
Returns true if we should iterate.

shouldExecute

protected boolean shouldExecute(InternalValidatorContext context,
                                ContextBean root,
                                java.lang.Object obj)
Determines whether the inclusion/call to the validation set should occur.

Specified by:
shouldExecute in class ValidationServiceValidator
Parameters:
context - The ValidatorContext
root - The ContextBean
obj - The object being validated.
Returns:
Returns true if the validation set should be called/executed.

mapObject

protected java.lang.Object mapObject(InternalValidatorContext context,
                                     ContextBean contextBean,
                                     java.lang.Object obj)
Handle the mapping of the object being validated to the property that will be validated (may be the object, itself).

Specified by:
mapObject in class ValidationServiceValidator
Parameters:
context - The ValidatorContext
contextBean - The ContextBean
obj - The object being validated.
Returns:
Returns the object that will be forwarded to the called validation set.

setMapExpression

public void setMapExpression(java.lang.String exp)
Overrides:
setMapExpression in class ValidationServiceValidator