Namespace: Validation

Oracle® JavaScript Extension Toolkit (JET)
7.1.0

F18183-01

QuickNav


Validation

Version:
  • 7.1.0
Since:
  • 0.6
Module:
  • ojvalidation-base

Module usage

See JET Module Loading for an overview of module usage within JET.

Javascript Import Format
define(['ojs/ojvalidation-base'], function(validationBase) {
 // Application should call API on validationBase.Validation 
})

JET In Typescript

A detailed description of working with JET elements and classes in your typescript project can be found at: JET Typescript Usage.

Used to register and retrieve converterFactories and validationFactories. There is no need to call the constructor.
See:

Methods

(static) converterFactory<CF extends ConverterFactory<any>>(type:'number'|'color'|'datetime'|string, instance?:CF): CF|null

Method to register and retrieve converter factory instances by name. When passed only the name, an existing factory (registered for the name) is returned. Callers can expect to get back the default 'number', 'datetime', or 'color' converters. When passed two arguments, a new factory for the name is registered. If the name already exists the new instance replaces the old one.
Parameters:
Name Type Argument Description
type string a case insensitive name of the converter factory. e.g., 'number' (or oj.ConverterFactory.CONVERTER_TYPE_NUMBER), 'datetime' (or oj.ConverterFactory.CONVERTER_TYPE_DATETIME), or 'color' (or oj.ConverterFactory.CONVERTER_TYPE_COLOR).
instance Object <optional>
the instance of the factory that implements the contract for oj.ConverterFactory.
See:

(static) getDefaultConverterFactory<V>(type: 'number'|'color'|'datetime'): ConverterFactory<V>|null

Returns the default converter factory instances for the supported types as defined by the oj.ConverterFactory. Instead of calling this method, it should be sufficient to use oj.Validation.converterFactory.
Parameters:
Name Type Description
type string The default converter factory for the type. Supported types are 'number' and 'datetime'
See:
Returns:
an instance of oj.ConverterFactory or null if an unknown type is requested.
Type
Object | null

(static) getDefaultValidatorFactory<V>(type: 'required'|'regexp'|'numberRange'|'length'|'dateTimeRange'|'dateRestriction'): ValidatorFactory<V>|null

Returns the default validator factory instance for the requested types as defined by the oj.ValidatorFactory. Instead of calling this method, it should be sufficient to use oj.Validation.validatorFactory.
Parameters:
Name Type Description
type string The default converter factory for the type. Supported types are 'number' and 'datetime'
See:
Returns:
an instance of oj.ConverterFactory or null if an unknown type is requested.
Type
Object | null

(static) validatorFactory<VF extends ValidatorFactory<any>>(type:'required'|'regexp'|'numberRange'|'length'|'dateTimeRange'|'dateRestriction'|string, instance?:VF): VF|null

Method to register and retrieve validator factory instances by name. When passed only the name, an existing factory (registered for the name) is returned. When passed two arguments, a new factory for the name is registered. If the name already exists the new instance replaces the old one.
Parameters:
Name Type Argument Description
type string a case insensitive name of the validator factory.
instance Object <optional>
the instance of the factory that implements the contract for oj.ValidatorFactory.
Since:
  • 0.6
See:

Type Definitions

RegisteredConverter

A ducktype for accessing converter created and/ registered by referring to oj.Validation.converterFactory
Properties:
Name Type Argument Description
type string the name of the factory registered converter
options Object <optional>
options to the converter

RegisteredValidator

A ducktype for accessing validator created and/ registered by referring to oj.Validation.validatorFactory
Properties:
Name Type Argument Description
type string the name of the factory registered validator
options Object <optional>
options to the validator