com.opensymphony.xwork.validator.validators
Class DoubleRangeFieldValidator
java.lang.Object
com.opensymphony.xwork.validator.validators.ValidatorSupport
com.opensymphony.xwork.validator.validators.FieldValidatorSupport
com.opensymphony.xwork.validator.validators.DoubleRangeFieldValidator
- All Implemented Interfaces:
- FieldValidator, ShortCircuitableValidator, Validator
public class DoubleRangeFieldValidator
- extends FieldValidatorSupport
Field Validator that checks if the double specified is within a certain range.
- fieldName - The field name this validator is validating. Required if using
Plain-Validator Syntax otherwise not required
- minInclusive - the minimum inclusive value in FloatValue format specified by Java language (if none is specified, it will
not be checked)
- maxInclusive - the maximum inclusive value in FloatValue format specified by Java language (if none is specified, it will
not be checked)
- minExclusive - the minimum exclusive value in FloatValue format specified by Java language (if none is specified, it will
not be checked)
- maxExclusive - the maximum exclusive value in FloatValue format specified by Java language (if none is specified, it will
not be checked)
<validators>
<!-- Plain Validator Syntax -->
<validator type="double">
<param name="fieldName">percentage</param>
<param name="minInclusive">20.1</param>
<param name="maxInclusive">50.1</param>
<message>Age needs to be between ${minInclusive} and
${maxInclusive} (inclusive)</message>
</validator>
<!-- Field Validator Syntax -->
<field name="percentage">
<field-validator type="double">
<param name="minExclusive">0.123</param>
<param name="maxExclusive">99.98</param>
<message>Percentage needs to be between ${minExclusive}
and ${maxExclusive} (exclusive)</message>
</field-validator>
</field>
</validators>
- Version:
- $Id: DoubleRangeFieldValidator.java 866 2006-03-04 09:59:20Z rainerh $
- Author:
- Rainer Hermanns, Rene Gielen
Methods inherited from class com.opensymphony.xwork.validator.validators.ValidatorSupport |
addActionError, addFieldError, conditionalParse, getDefaultMessage, getFieldValue, getMessage, getMessageKey, getMessageParameters, getParse, getValidatorContext, isShortCircuit, setDefaultMessage, setMessageKey, setMessageParameters, setParse, setShortCircuit, setValidatorContext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DoubleRangeFieldValidator
public DoubleRangeFieldValidator()
validate
public void validate(Object object)
throws ValidationException
- Description copied from interface:
Validator
- The validation implementation must guarantee that setValidatorContext will
be called with a non-null ValidatorContext before validate is called.
- Throws:
ValidationException
setMaxInclusive
public void setMaxInclusive(String maxInclusive)
getMaxInclusive
public String getMaxInclusive()
setMinInclusive
public void setMinInclusive(String minInclusive)
getMinInclusive
public String getMinInclusive()
getMinExclusive
public String getMinExclusive()
setMinExclusive
public void setMinExclusive(String minExclusive)
getMaxExclusive
public String getMaxExclusive()
setMaxExclusive
public void setMaxExclusive(String maxExclusive)