Constructor
new RegExpValidatorFactory()
A factory implementation that creates an instance of the built-in regExp validator of type
oj.RegExpValidator.
- Source:
- ojvalidation/ValidationFactoryImpl.js, line 140
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:
- ojvalidation/ValidationFactoryImpl.js, line 177
Returns:
- Type
- oj.RegExpValidator