net.sf.springlayout.web.validator
Class DecimalNumberRangeValidator

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

public class DecimalNumberRangeValidator
extends AbstractValidationRule

Provides number validation against the supplied range values.

Author:
Rob Monie, Adam Boas

Constructor Summary
DecimalNumberRangeValidator()
           
DecimalNumberRangeValidator(double minValue, 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 setMinValue(double minValue)
          Sets the minValue 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 min and max values.
 
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

DecimalNumberRangeValidator

public DecimalNumberRangeValidator()

DecimalNumberRangeValidator

public DecimalNumberRangeValidator(double minValue,
                                   double maxValue)
Construct Validator with min and max values

Parameters:
minValue -
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.

setMinValue

public void setMinValue(double minValue)
Sets the minValue for this IntegerNumberRangeValidator.

Parameters:
minValue - Sets the minValue 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 min and max values.

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)

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:

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:


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