Constructor
new LengthValidatorFactory()
Returns an instance of oj.LengthValidatorFactory that provides a factory method to create an
instance of a length validator.
- Source:
- ojvalidation/ValidationFactoryImpl.js, line 315
Example
create an instance of the length validator using the factory
var lvf = oj.Validation.validatorFactory(oj.ValidatorFactory.VALIDATOR_TYPE_LENGTH);
var options = {hint: {hintMaximum: 'Enter {max} or fewer characters'}, max: 10};
var lValidator = lvf.createValidator(options);
Methods
-
<static> 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. - Source:
- ojvalidation/ValidationFactoryImpl.js, line 348
Returns:
- Type
- oj.LengthValidator