net.sf.springlayout.web.validator
Class MaxValueValidator

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

public class MaxValueValidator
extends AbstractValidationRule

Provides number validation against the supplied maximum value.

Author:
Adam Boas

Constructor Summary
MaxValueValidator()
           
MaxValueValidator(double maxValue)
          Construct Validator with min and max values
 
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 setMaxValue(double maxValue)
          Sets the maxValue for this IntegerNumberRangeValidator.
 void validate(javax.servlet.http.HttpServletRequest request, java.lang.Object obj, org.springframework.validation.Errors errors, java.lang.String fieldKey)
          Validates object against max value.
 
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

MaxValueValidator

public MaxValueValidator()

MaxValueValidator

public MaxValueValidator(double maxValue)
Construct Validator with min and max values

Parameters:
maxValue -
maxValue -
Throws:
java.lang.NullPointerException
Method Detail

setMaxValue

public void setMaxValue(double maxValue)
Sets the maxValue for this IntegerNumberRangeValidator.

Parameters:
maxValue - Sets the maxValue for this IntegerNumberRangeValidator.

validate

public void validate(javax.servlet.http.HttpServletRequest request,
                     java.lang.Object obj,
                     org.springframework.validation.Errors errors,
                     java.lang.String fieldKey)
Validates object against max value.

Specified by:
validate in class AbstractValidationRule
See Also:
net.sf.springlayout.web.validator.ValidationRule#validate(javax.servlet.http.HttpServletRequest, java.lang.Object, org.springframework.validation.Errors, java.lang.String)

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:

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:


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