Skip to content

API / geotoolkit / persistence / JsonSerializer / JsonSerializer

Class: JsonSerializer

persistence.JsonSerializer.JsonSerializer

The JsonSerializer class exposes the trivial serialization functions from a JavaScript object to JSON and back

Table of contents

Constructors
  • [new JsonSerializer(registry, options)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.persistence.jsonserializer.jsonserializer.md#new jsonserializer(registry, options))
Methods

Contents

Constructors

new JsonSerializer(registry, options)

• new JsonSerializer(registry, options?)

Parameters

Name Type Description
registryRegistryregistry of serializers
Optional optionsOptionsserialization options
Methods

deserialize

▸ deserialize(str): MementoDeserializationContext

Deserializes a JSON string to the original object

Parameters

Name Type Description
strstringtext to be deserialised

Returns

MementoDeserializationContext


serialize

▸ serialize(name, value?, source?): string

Serializes an object to a JSON string

Parameters

Name Type Description
namestringthe name of the object or the object to mementoize
Optional valueanyThe value to mementoize
Optional sourceanythe source project to add property

Returns

string