Caplin Trader 4.1.0

Class: module:caplin/core/validator/NumericRangeValidator



new module:caplin/core/validator/NumericRangeValidator(errorMessageopt)

The NumericRangeValidator is a module:caplin/trading/validation/Validator that ensures the string being validated is an expression of a decimal number. Empty string is allowed: if you don't want to allow empty string, use the module:br/presenter/validator/NotEmptyValidator.
Name Type Attributes Description
errorMessage string <optional>
i18n key for error message to be passed to the ValidationResult.


validate(properties, oValidationResult)

Determine whether parsing the given string results in a decimal number and set result on the provided module:caplin/core/ValidationResult.
Name Type Description
properties object A named set of properties to validate.
Name Type Description
from object An object with a getValue() method that returns the from string to be validated.
to object An object with a getValue() method that returns the to string to be validated.
oValidationResult module:br/presenter/validator/ValidationResult The result object that the outcome of the validation will be set on.