Class IntegerRangeValidator
java.lang.Object
org.apache.fulcrum.intake.validator.DefaultValidator<Integer>
org.apache.fulcrum.intake.validator.NumberValidator<Integer>
org.apache.fulcrum.intake.validator.IntegerValidator
org.apache.fulcrum.intake.validator.IntegerRangeValidator
- All Implemented Interfaces:
org.apache.avalon.framework.logger.LogEnabled,InitableByConstraintMap,Validator<Integer>
Validates an int field in dependency on another int field.
| Name | Valid Values | Default Value |
|---|---|---|
| less-than | <name of other field> | |
| greater-than | <name of other field> | |
| less-than-or-equal | <name of other field> | |
| greater-than-or-equal | <name of other field> |
- Version:
- $Id$
- Author:
- Thomas Vandahl
-
Field Summary
Fields inherited from class org.apache.fulcrum.intake.validator.DefaultValidator
errorMessage, log, maxLength, maxLengthMessage, minLength, minLengthMessage, required, requiredMessageFields inherited from interface org.apache.fulcrum.intake.validator.Validator
FLEXIBLE_RULE_NAME, FORMAT_RULE_NAME, INVALID_NUMBER_RULE_NAME, MASK_RULE_NAME, MAX_LENGTH_RULE_NAME, MAX_VALUE_RULE_NAME, MIN_LENGTH_RULE_NAME, MIN_VALUE_RULE_NAME, REQUIRED_RULE_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassertValidity(String testValue, Group group, Locale locale) Determine whether a testValue meets the criteria specified in the constraints defined for this validatorvoidassertValidity(Field<Integer> testField) Determine whether a testValue meets the criteria specified in the constraints defined for this validatorvoidinit(Map<String, ? extends Constraint> paramMap) Constructor to use when initializing ObjectMethods inherited from class org.apache.fulcrum.intake.validator.IntegerValidator
parseNumberMethods inherited from class org.apache.fulcrum.intake.validator.NumberValidator
assertValidity, getInvalidNumberMessage, getMaxValue, getMaxValueMessage, getMinValue, getMinValueMessage, parseIntoNumber, setInvalidNumberMessage, setMaxValue, setMaxValueMessage, setMinValue, setMinValueMessageMethods inherited from class org.apache.fulcrum.intake.validator.DefaultValidator
assertValidity, enableLogging, getMaxLength, getMaxLengthMessage, getMessage, getMinLength, getMinLengthMessage, getRequiredMessage, isRequired, isValid, isValid, setMaxLength, setMaxLengthMessage, setMinLength, setMinLengthMessage, setRequired, setRequiredMessage
-
Constructor Details
-
IntegerRangeValidator
public IntegerRangeValidator()Default constructor
-
-
Method Details
-
init
Constructor to use when initializing Object- Specified by:
initin interfaceInitableByConstraintMap- Overrides:
initin classNumberValidator<Integer>- Parameters:
paramMap- a map of parameters- Throws:
InvalidMaskException- one of the mask rules is invalid
-
assertValidity
Determine whether a testValue meets the criteria specified in the constraints defined for this validator- Specified by:
assertValidityin interfaceValidator<Integer>- Overrides:
assertValidityin classNumberValidator<Integer>- Parameters:
testField- aFieldto be tested- Throws:
ValidationException- containing an error message if the testValue did not pass the validation tests.
-
assertValidity
Determine whether a testValue meets the criteria specified in the constraints defined for this validator- Parameters:
testValue- aStringto be testedgroup- the group this field belongs tolocale- the locale for this field- Throws:
ValidationException- containing an error message if the testValue did not pass the validation tests.
-