Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.opensymphony.xwork2.validator.validators
Class IntRangeFieldValidator

    java.lang.Object
      com.opensymphony.xwork2.validator.validators.ValidatorSupport
          com.opensymphony.xwork2.validator.validators.FieldValidatorSupport
              com.opensymphony.xwork2.validator.validators.AbstractRangeValidator
                  com.opensymphony.xwork2.validator.validators.IntRangeFieldValidator

All Implemented Interfaces:
  FieldValidator, ShortCircuitableValidator, Validator

    public class IntRangeFieldValidator

extends AbstractRangeValidator

Field Validator that checks if the integer specified is within a certain range.

- fieldName - The field name this validator is validating. Required if using Plain-Validator Syntax otherwise not required
- min - the minimum value (if none is specified, it will not be checked)
- max - the maximum value (if none is specified, it will not be checked)

                    <validators>
               <!-- Plain Validator Syntax -->
               <validator type="int">
                   <param name="fieldName">age</param>
                   <param name="min">20</param>
                   <param name="max">50</param>
                   <message>Age needs to be between ${min} and ${max}</message>
               </validator>

               <!-- Field Validator Syntax -->
               <field name="age">
                   <field-validator type="int">
                       <param name="min">20</param>
                       <param name="max">50</param>
                       <message>Age needs to be between ${min} and ${max}</message>
                   </field-validator>
               </field>
          </validators>

Version:
  $Date: 2006-07-10 02:30:29 +0200 (Mon, 10 Jul 2006) $ $Id: IntRangeFieldValidator.java 1063 2006-07-10 00:30:29Z mrdon $
Author:
  Jason Carreira

Field Summary
`(package private) Integer` | `max`
`(package private) Integer` | `min`

Fields inherited from class com.opensymphony.xwork2.validator.validators.ValidatorSupport
`defaultMessage, log, messageKey`

Constructor Summary
`IntRangeFieldValidator()`

Method Summary
`Integer` | `getMax()`
`Comparable` | `getMaxComparatorValue()`
`Integer` | `getMin()`
`Comparable` | `getMinComparatorValue()`
`void` | `setMax(Integer max)`
`void` | `setMin(Integer min)`

Methods inherited from class com.opensymphony.xwork2.validator.validators.AbstractRangeValidator
`validate`

Methods inherited from class com.opensymphony.xwork2.validator.validators.FieldValidatorSupport
`getFieldName, getValidatorType, setFieldName, setValidatorType`

Methods inherited from class com.opensymphony.xwork2.validator.validators.ValidatorSupport
`addActionError, addFieldError, conditionalParse, getDefaultMessage, getFieldValue, getMessage, getMessageKey, getParse, getValidatorContext, isShortCircuit, setDefaultMessage, setMessageKey, setParse, setShortCircuit, setValidatorContext`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface com.opensymphony.xwork2.validator.Validator
`getDefaultMessage, getMessage, getMessageKey, getValidatorContext, setDefaultMessage, setMessageKey, setValidatorContext`

Field Detail

### max

    Integer max

### min

    Integer min

Constructor Detail

### IntRangeFieldValidator

    public IntRangeFieldValidator()

Method Detail

### setMax

    public void setMax(Integer max)

### getMax

    public Integer getMax()

### getMaxComparatorValue

    public Comparable getMaxComparatorValue()

  Specified by:
    `getMaxComparatorValue` in class `AbstractRangeValidator`

### setMin

    public void setMin(Integer min)

### getMin

    public Integer getMin()

### getMinComparatorValue

    public Comparable getMinComparatorValue()

  Specified by:
    `getMinComparatorValue` in class `AbstractRangeValidator`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2007 OpenSymphony. All Rights Reserved.