- Deprecated:
Since Description 8.0.0Use string literals instead of the member constants.
Constructor
(abstract) new ConverterFactory()
Contract for a ConverterFactory that provides a factory method to create a converter instance for
the requested type. Factories handle the details of object creation.
It allows the consumers of the factory to create specific converters
without knowing the internals of the converter creation.
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.
- Deprecated:
Since Description 8.0.0Use string literals instead of the member constants.
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.
- Deprecated:
Since Description 8.0.0Use the string instead.
-
(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.
- Deprecated:
Since Description 8.0.0Use the string instead.
-
(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.
- Deprecated:
Since Description 8.0.0Use the string instead.
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 optionsObject <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