Usage
Signature:
class ConverterFactory<V, O>
Generic Parameters
Parameter Description V Type of value to be converted
Javascript Import Format
define(['ojs/ojvalidationfactory-base'], function(validationfactoryBase) { // Application should call API on validationfactoryBase.ConverterFactory })
Typescript Import Format
//To import this class, use the format below.
import {ConverterFactory} from "ojs/ojvalidationfactory-base";
For additional information visit:
Constructor
(abstract) new ConverterFactory
JET provides three factory implementations for number and datetime and color types that implement this contract.
Customers can register custom converter factories for the supported types or create and register factories for new types altogether.
Fields
-
(static) CONVERTER_TYPE_COLOR :string
-
Default type for a factory used to create color converters. This type is passed to the Validation.converterFactory method to retrieve the color converter factory of type oj.ColorConverterFactory.
-
(static) CONVERTER_TYPE_DATETIME :string
-
Default type for a factory used to create datetime converters. This type is passed to the Validation.converterFactory method to retrieve the datetime converter factory of type oj.DateTimeConverterFactory.
-
(static) CONVERTER_TYPE_NUMBER :string
-
Default type for a factory used to create number converters. This type is passed to the Validation.converterFactory method to retrieve the number converter factory of type oj.NumberConverterFactory.
Methods
-
createConverter(options?: O): Converter<V> | Promise.<Converter<V>>
-
Creates an immutable converter instance of the type the factory implements.
Parameters:
Name Type Argument Description options
Object <optional>
an object literal containing properties required by the converter for its initialization. The properties provided in the options is implementation specific. Throws:
if an unrecognized type was provided- Type
- TypeError
Returns:
a converter instance.
- Type
- oj.Converter