Class: LengthValidatorFactory

Oracle® JavaScript Extension Toolkit (JET)
5.0.0

E90577-01

QuickNav

LengthValidatorFactory

Version:
  • 5.0.0
Since:
  • 0.6
Module:
  • ojvalidation-base
Returns an instance of oj.LengthValidatorFactory that provides a factory method to create an instance of a length validator.
Example

create an instance of the length validator using the factory

var lvf = oj.Validation.validatorFactory(oj.ValidatorFactory.VALIDATOR_TYPE_LENGTH);
var options = {hint: {max: 'Enter {max} or fewer characters'}, max: 10};
var lValidator = lvf.createValidator(options);

Methods

createValidator(options) → {oj.LengthValidator}

Creates an immutable validator instance of type oj.LengthValidator that ensures that the value provided is withing a given length.
Parameters:
Name Type Argument Description
options Object <optional>
an object literal used to provide the 'minimum', 'maximum' and other optional values. See oj.LengthValidator for details.

Returns:
Type
oj.LengthValidator