Constructor
<abstract> new ValidatorFactory()
Contract for a ValidatorFactory that provides a factory method to create a validator instance for
the requested type. JET provides several factory implementations that implement this contract -
for example dateRestriction, dateTimeRange, numberRange, length, required, regexp. Customers can
register custom validator factories for the supported types or create and register factories for
new types altogether.
Fields
-
<static> VALIDATOR_TYPE_DATERESTRICTION :string
-
Default type for a factory used to create date restriction validators. This type is passed to the Validation.validatorFactory method to retrieve the dateRestriction validator factory of type oj.DateRestrictionValidatorFactory.
- Source:
-
<static> VALIDATOR_TYPE_DATETIMERANGE :string
-
Default type for a factory used to create required validators. This type is passed to the Validation.validatorFactory method to retrieve the dateTimeRange validator factory of type oj.DateTimeRangeValidatorFactory.
- Source:
-
<static> VALIDATOR_TYPE_LENGTH :string
-
Default type for a factory used to create length validators. This type is passed to the Validation.validatorFactory method to retrieve the length validator factory of type oj.LengthValidatorFactory.
- Source:
-
<static> VALIDATOR_TYPE_NUMBERRANGE :string
-
Default type for a factory used to create numberRange validators. This type is passed to the Validation.validatorFactory method to retrieve the numberRange validator factory of type oj.NumberRangeValidatorFactory.
- Source:
-
<static> VALIDATOR_TYPE_REGEXP :string
-
Default type for a factory used to create regExp validators. This type is passed to the Validation.validatorFactory method to retrieve the regExp validator factory of type oj.RegExpValidatorFactory.
- Source:
-
<static> VALIDATOR_TYPE_REQUIRED :string
-
Default type for a factory used to create required validators. This type is passed to the Validation.validatorFactory method to retrieve the required validator factory of type oj.RequiredValidatorFactory.
- Source:
Methods
-
<static> createValidator(options) → {Object}
-
Creates an immutable validator instance of the type the factory implements.
Parameters:
Name Type Description options
Object | null an object literal containing properties required by the validator for its initialization. The properties provided in the options is implementation specific. - Source:
Throws:
if an unrecognized type was provided- Type
- TypeError
Returns:
a validator instance.- Type
- Object