net.sf.springlayout.web.validator
Interface ValidationRule

All Known Implementing Classes:
AbstractValidationRule, DateValidator, DecimalNumberRangeValidator, DecimalValidator, EmailValidator, IntegerNumberRangeValidator, IntegerValidator, MaxLengthValidator, MaxValueValidator, MinLengthValidator, MinValueValidator

public interface ValidationRule

Defines a validation rule for use by fieldDefininitions

Author:
monier

Method Summary
 void conditionallyValidate(javax.servlet.http.HttpServletRequest request, java.lang.Object obj, org.springframework.validation.Errors errors, java.lang.String fieldKey)
          Validates the command object against this validation rule and adds to the errors if validation fails.
 java.lang.String getConditionalJavascript(OnPageFieldInstance fieldInstance, java.lang.Object command, java.lang.String formName)
          Retrieves a javascript representation of this validation rule which will be applied to each of the events supplied in eventNames.
 boolean isValid(java.lang.Object obj, java.lang.String fieldKey)
          Returns if this object is valid according to this validation rule
 

Method Detail

conditionallyValidate

void conditionallyValidate(javax.servlet.http.HttpServletRequest request,
                           java.lang.Object obj,
                           org.springframework.validation.Errors errors,
                           java.lang.String fieldKey)
Validates the command object against this validation rule and adds to the errors if validation fails.

Parameters:
request - the current HttpServletRequest
obj - the current command object to be validated
errors - the current errors for this request
fieldKey - the path or key to the field in the target object to validate

isValid

boolean isValid(java.lang.Object obj,
                java.lang.String fieldKey)
Returns if this object is valid according to this validation rule

Parameters:
obj -
Returns:

getConditionalJavascript

java.lang.String getConditionalJavascript(OnPageFieldInstance fieldInstance,
                                          java.lang.Object command,
                                          java.lang.String formName)
Retrieves a javascript representation of this validation rule which will be applied to each of the events supplied in eventNames. This function will be 'anded' together with other rules and so should always return boolean and have no semi-colon eg. A == B The context which surrounds this javascrit must contain the 'field' to execute this javascript upon.

Parameters:
fieldInstance -
command -
formName -
Returns:
String containing the conditional javascript registration for this validation rule against the event names supplied.


Copyright © 2005-2007 Spring Layout Team. All Rights Reserved.