Class: RegExpValidatorFactory

Oracle® JavaScript Extension Toolkit (JET)
5.0.0

E90577-01

QuickNav

RegExpValidatorFactory

Version:
  • 5.0.0
Since:
  • 0.6
Module:
  • ojvalidation-base
A factory implementation that creates an instance of the built-in regExp validator of type oj.RegExpValidator.
Example

create an instance of the regExp validator using the factory

var rvf = oj.Validation.validatorFactory(oj.ValidatorFactory.VALIDATOR_TYPE_REGEXP);  
var usernameValidator = rvf.createValidator(
 {
   'pattern': '[a-zA-Z0-9]{3,}', 
   'messageDetail': 'You must enter at least 3 letters or numbers'}
 });

Methods

createValidator(options) → {oj.RegExpValidator}

Creates an immutable validator instance of type oj.RegExpValidator that ensures the value matches the provided pattern.
Parameters:
Name Type Description
options Object an object literal used to provide the pattern, an optional hint, error message among others. See oj.RegExpValidator for details.

Returns:
Type
oj.RegExpValidator