Serializer class
Constructors
Serializer({[key: string]: any}, boolean) |
Properties
isXML | |
model |
Methods
deserialize(Mapper, any, string) | Deserialize the given object based on its metadata defined in the mapper |
serialize(Mapper, any, string) | Serialize the given object based on its metadata defined in the mapper |
validate |
Constructor Details
Serializer({[key: string]: any}, boolean)
new Serializer(modelMappers?: {[key: string]: any}, isXML?: boolean)
Parameters
- modelMappers
-
{[key: string]: any}
- isXML
-
boolean
Property Details
isXML
isXML?: boolean
Property Value
boolean
modelMappers
modelMappers: {[key: string]: any}
Property Value
{[key: string]: any}
Method Details
deserialize(Mapper, any, string)
Deserialize the given object based on its metadata defined in the mapper
function deserialize(mapper: Mapper, responseBody: any, objectName: string): any
Parameters
- mapper
- Mapper
The mapper which defines the metadata of the serializable object
- responseBody
-
any
A valid Javascript entity to be deserialized
- objectName
-
string
Name of the deserialized object
Returns
any
A valid deserialized Javascript object
serialize(Mapper, any, string)
Serialize the given object based on its metadata defined in the mapper
function serialize(mapper: Mapper, object: any, objectName?: string): any
Parameters
- mapper
- Mapper
The mapper which defines the metadata of the serializable object
- object
-
any
A valid Javascript object to be serialized
- objectName
-
string
Name of the serialized object
Returns
any
A valid serialized Javascript object
validateConstraints(Mapper, any, string)
function validateConstraints(mapper: Mapper, value: any, objectName: string)
Parameters
- mapper
- Mapper
- value
-
any
- objectName
-
string