Constructor
<abstract> new ValidatorFactory()
The contract for a ValidatorFactory that provides a factory method to create a validator by its
type.
- Source:
- ojvalidation/ValidationFactory.js, line 292
Fields
-
<static> VALIDATOR_TYPE_DATERESTRICTION
-
Default validator type for date restriction validation, used to create an instance of type oj.DateRestrictionValidator.
- Source:
- ojvalidation/ValidationFactory.js, line 349
-
<static> VALIDATOR_TYPE_DATETIMERANGE
-
Default validator type for range validation involving datetimes, used to create an instance of type oj.DateTimeRangeValidator.
- Source:
- ojvalidation/ValidationFactory.js, line 341
-
<static> VALIDATOR_TYPE_LENGTH
-
Default validator type for length validation, used to create an instance of type oj.LengthValidator.
- Source:
- ojvalidation/ValidationFactory.js, line 333
-
<static> VALIDATOR_TYPE_NUMBERRANGE
-
Default validator type for range validation involving numbers, used to create an instance of type oj.NumberRangeValidator.
- Source:
- ojvalidation/ValidationFactory.js, line 325
-
<static> VALIDATOR_TYPE_REGEXP
-
Default validator type for regular expression based validation, used to create an instance of type oj.RegExpValidator.
- Source:
- ojvalidation/ValidationFactory.js, line 317
-
<static> VALIDATOR_TYPE_REQUIRED
-
Default validator type for required validation, used to create an instance of type oj.RequiredValidator.
- Source:
- ojvalidation/ValidationFactory.js, line 309
Methods
-
<static> createValidator(options) → {Object}
-
Creates an immutable validator instance of the requested type. Implementations can register custom validator factories for the supported or new types.
Parameters:
Name Type Description options
Object | null an object containing the options required by the validator for its initialization. The key value pairs used in the options is implementation specific. - Source:
- ojvalidation/ValidationFactory.js, line 362
Throws:
if an unrecognized type was provided- Type
- TypeError
Returns:
a validator instance.- Type
- Object