A Serializer implementation supporting JSON as payload format.

Hierarchy

  • JSONSerializer

Implements

Constructors

Properties

_format: string = 'json'
JSON_SERIALIZER_PREFIX: number = 21
_handlers: Map<string, TypeHandler> = ...

Accessors

  • get format(): string
  • The serializer format.

    Returns string

Methods

  • Protected

    Passed as the replacer argument to JSON.stringify(). This is responsible for converting Objects to a format that will be understood by Java/Coherence.

    Parameters

    • key: any

      the key being of the value being replaced

    • value: any

      the value associated with the key

    Returns any

  • Protected

    Passed as the reviver argument to JSON.parse(). This is responsible for reconstituting Objects based on the @class metadata sent from Coherence.

    Parameters

    • key: String

      the key of the value being revived

    • value: any

      the value associated with the key

    Returns any

  • Deserializes and returns a new Javascript object.

    Returns

    The deserialized object.

    Parameters

    • value: any

      The object to be deserialized.

    Returns any

  • Serializes the specified object and returns the `Buffer`` containing the serialized data.

    @param obj the object to be serialized

    @returns the `Buffer`` containing the serialized data.

    Parameters

    • obj: any

    Returns Buffer

  • Adds or replaces a TypeHandler based on the result of TypeHandler.type.

    Parameters

    Returns void