net.sf.springlayout.web.validator
Class MinLengthValidator

java.lang.Object
  extended by net.sf.springlayout.web.validator.AbstractValidationRule
      extended by net.sf.springlayout.web.validator.MinLengthValidator
All Implemented Interfaces:
ValidationRule

public class MinLengthValidator
extends AbstractValidationRule

Enforces that a String field be of a minimum length. This enforces that the field not be null.


Constructor Summary
MinLengthValidator()
           
 
Method Summary
 java.lang.String getJavascript()
          Get the javascript used to validate this rule
 boolean isValid(java.lang.Object obj, java.lang.String fieldKey)
          Returns if this object is valid according to this validation rule
 void setMinLength(int minLength)
          Sets the minLength for this MinLengthValidator.
 void validate(javax.servlet.http.HttpServletRequest request, java.lang.Object obj, org.springframework.validation.Errors errors, java.lang.String fieldKey)
          Validate the object
 
Methods inherited from class net.sf.springlayout.web.validator.AbstractValidationRule
conditionallyValidate, getCondition, getConditionalJavascript, getFieldValue, setCondition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MinLengthValidator

public MinLengthValidator()
Method Detail

getJavascript

public java.lang.String getJavascript()
Description copied from class: AbstractValidationRule
Get the javascript used to validate this rule

Specified by:
getJavascript in class AbstractValidationRule
Returns:

validate

public void validate(javax.servlet.http.HttpServletRequest request,
                     java.lang.Object obj,
                     org.springframework.validation.Errors errors,
                     java.lang.String fieldKey)
Description copied from class: AbstractValidationRule
Validate the object

Specified by:
validate in class AbstractValidationRule

isValid

public boolean isValid(java.lang.Object obj,
                       java.lang.String fieldKey)
Description copied from interface: ValidationRule
Returns if this object is valid according to this validation rule

Returns:

setMinLength

public void setMinLength(int minLength)
Sets the minLength for this MinLengthValidator.

Parameters:
minLength - Sets the minLength for this MinLengthValidator.


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