Class ShortValidator
java.lang.Object
org.apache.fulcrum.intake.validator.DefaultValidator<Short>
org.apache.fulcrum.intake.validator.NumberValidator<Short>
org.apache.fulcrum.intake.validator.ShortValidator
- All Implemented Interfaces:
org.apache.avalon.framework.logger.LogEnabled
,InitableByConstraintMap
,Validator<Short>
Validates Shorts with the following constraints in addition to those
listed in NumberValidator and DefaultValidator.
Name | Valid Values | Default Value |
---|---|---|
minValue | greater than Short.MIN_VALUE | |
maxValue | less than Short.MAX_VALUE | |
invalidNumberMessage | Some text | Entry was not a valid Short |
- Version:
- $Id$
- Author:
- John McNally, Colin Chalmers, Jürgen Hoffmann
-
Field Summary
Fields inherited from class org.apache.fulcrum.intake.validator.DefaultValidator
errorMessage, log, maxLength, maxLengthMessage, minLength, minLengthMessage, required, requiredMessage
Fields 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 TypeMethodDescriptionprotected Short
parseNumber
(String stringValue, Locale locale) Parse the actual value out of a stringMethods inherited from class org.apache.fulcrum.intake.validator.NumberValidator
assertValidity, assertValidity, getInvalidNumberMessage, getMaxValue, getMaxValueMessage, getMinValue, getMinValueMessage, init, parseIntoNumber, setInvalidNumberMessage, setMaxValue, setMaxValueMessage, setMinValue, setMinValueMessage
Methods 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
-
ShortValidator
public ShortValidator()Default Constructor
-
-
Method Details
-
parseNumber
Description copied from class:NumberValidator
Parse the actual value out of a string- Specified by:
parseNumber
in classNumberValidator<Short>
- Parameters:
stringValue
- the string valuelocale
- the locale to use while parsing- Returns:
- the value
- Throws:
NumberFormatException
- if the value could not be parsed- See Also:
-