org.iscreen.mvel
Class MvelValidationServiceValidator

java.lang.Object
  extended by org.iscreen.impl.ValidationServiceValidator
      extended by org.iscreen.mvel.MvelValidationServiceValidator
All Implemented Interfaces:
ValidatorWrapper

public class MvelValidationServiceValidator
extends ValidationServiceValidator

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
MvelValidationServiceValidator(DefaultValidationService service, ValidationService theParentService)
          Default constructor.
 
Method Summary
protected  java.io.Serializable getCompiledIfExpression()
           
protected  java.io.Serializable getCompiledMapExpression()
           
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 setIfExpression(java.lang.String exp)
           
 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, 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

MvelValidationServiceValidator

public MvelValidationServiceValidator(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.

getCompiledIfExpression

protected java.io.Serializable getCompiledIfExpression()

getCompiledMapExpression

protected java.io.Serializable getCompiledMapExpression()

setIfExpression

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

setMapExpression

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