Class: RegExpValidatorFactory

Oracle® JavaScript Extension Toolkit (JET)
3.2.0

E87541-01

QuickNav

oj. RegExpValidatorFactory

Version:
  • 3.2.0
Since:
  • 0.6

Constructor

new RegExpValidatorFactory()

A factory implementation that creates an instance of the built-in regExp validator of type oj.RegExpValidator.
Source:
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

<static> 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.

Source:
Returns:
Type
oj.RegExpValidator