Class FloatValidator
java.lang.Object
org.apache.fulcrum.intake.validator.DefaultValidator<Float>
org.apache.fulcrum.intake.validator.NumberValidator<Float>
org.apache.fulcrum.intake.validator.FloatValidator
- All Implemented Interfaces:
org.apache.avalon.framework.logger.LogEnabled
,InitableByConstraintMap
,Validator<Float>
Validates Floats with the following constraints in addition to those
listed in NumberValidator and DefaultValidator.
Name | Valid Values | Default Value |
---|---|---|
minValue | greater than Float.MIN_VALUE | |
maxValue | less than Float.MAX_VALUE | |
invalidNumberMessage | Some text | Entry was not a valid number |
- Version:
- $Id$
- Author:
- John McNally, Colin Chalmers, Jürgen Hoffmann, Thomas Vandahl
-
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 Float
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
-
FloatValidator
public FloatValidator()Default Constructor
-
-
Method Details
-
parseNumber
Description copied from class:NumberValidator
Parse the actual value out of a string- Specified by:
parseNumber
in classNumberValidator<Float>
- 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:
-