-
<static> converterFactory(type, instance)
-
Module 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' and 'datetime' 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. |
instance |
Object
|
<optional>
|
the instance of the factory that implements the contract for
oj.ConverterFactory. |
- Source:
- See:
-
-
<static> getDefaultConverterFactory(type) → {Object}
-
Returns the default converter factory instances for the supported types as defined by the
oj.ConverterFactory.
Parameters:
Name |
Type |
Description |
type |
string
|
The default converter factory for the type. Supported types are 'number' and
'datetime' |
- Source:
- See:
-
Returns:
an instance of oj.ConverterFactory or null if an unknown type is requested.
-
Type
-
Object
-
<static> getDefaultValidatorFactory(type) → {Object}
-
Returns the default validator factory instance for the requested types as defined by the
oj.ValidatorFactory.
Parameters:
Name |
Type |
Description |
type |
string
|
The default converter factory for the type. Supported types are 'number' and
'datetime' |
- Source:
- See:
-
Returns:
an instance of oj.ConverterFactory or null if an unknown type is requested.
-
Type
-
Object
-
<static> validatorFactory(type, instance)
-
Module 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. |
- Source:
- See:
-