com.opensymphony.xwork2.validator.validators
public class: ShortRangeFieldValidator [javadoc |
source]
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.ShortRangeFieldValidator
All Implemented Interfaces:
FieldValidator, ShortCircuitableValidator, Validator
Field Validator that checks if the short 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="short">
<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="short">
<param name="min">20</param>
<param name="max">50</param>
<message>Age needs to be between ${min} and ${max}</message>
</field-validator>
</field>
</validators>
| Field Summary |
|---|
| Short | max | |
| Short | min | |
| Methods from com.opensymphony.xwork2.validator.validators.ValidatorSupport: |
|---|
|
addActionError, addFieldError, conditionalParse, getDefaultMessage, getFieldValue, getMessage, getMessageKey, getParse, getValidatorContext, getValidatorType, isShortCircuit, setDefaultMessage, setMessageKey, setParse, setShortCircuit, setValidatorContext, setValidatorType, setValueStack |