Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Serializer

Package version

Hierarchy

  • Serializer

Index

Constructors

constructor

  • new Serializer(modelMappers?: undefined | object, isXML?: boolean | undefined): Serializer
  • Parameters

    • Optional modelMappers: undefined | object
    • Optional isXML: boolean | undefined

    Returns Serializer

Properties

Optional isXML

isXML: boolean | undefined

modelMappers

modelMappers: object

Type declaration

  • [key: string]: any

Methods

deserialize

  • deserialize(mapper: Mapper, responseBody: any, objectName: string): any
  • Deserialize the given object based on its metadata defined in the mapper

    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

  • serialize(mapper: Mapper, object: any, objectName?: undefined | string): any
  • Serialize the given object based on its metadata defined in the mapper

    Parameters

    • mapper: Mapper

      The mapper which defines the metadata of the serializable object

    • object: any

      A valid Javascript object to be serialized

    • Optional objectName: undefined | string

      Name of the serialized object

    Returns any

    A valid serialized Javascript object

validateConstraints

  • validateConstraints(mapper: Mapper, value: any, objectName: string): void
  • Parameters

    • mapper: Mapper
    • value: any
    • objectName: string

    Returns void

Generated using TypeDoc