Skip to content

API / geotoolkit / persistence / SerializationContext / SerializationContext

Class: SerializationContext

persistence.SerializationContext.SerializationContext

The serialization context

Hierarchy

Implements

Table of contents

Constructors
  • [new SerializationContext()](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.persistence.serializationcontext.serializationcontext.md#new serializationcontext())
Methods

Contents

Constructors

new SerializationContext()

• new SerializationContext()

Methods

addObject

▸ Abstract addObject(name, object, type?): SerializationContext

Adds child element with the specified name and optional type to the current context. Unlike "setObject", this method creates a child node to store the object.

Parameters

Name Type Description
namestring | numberunique property name
objectanyobject to be serialized
Optional typestringthe optional serialization type

Returns

SerializationContext


addReference

▸ Abstract addReference(object): string | number

Add reference to the object

Parameters

Name Type Description
objectanyobject to get reference

Returns

string | number

id of the reference


addValue

▸ Abstract addValue(name, value): void

Adds the specified value with name "name" to the current context

Parameters

Name Type Description
namestringunique property name
valueanyobject value

Returns

void


commit

▸ Abstract commit(): void

Commit changes

Returns

void


createChild

▸ Abstract createChild(name, type?): SerializationContext

Create child element in the current context

Parameters

Name Type Description
namestringunique property name
Optional typestringtype of the object

Returns

SerializationContext


getOptions

▸ Abstract getOptions(): Options

Return serialization options

Returns

Options

Implementation of

ISerializationContext.getOptions


getReferenceId

▸ Abstract getReferenceId(object): string | number

Get reference id for the specified object. Null as return value means that the object was not saved before

Parameters

Name Type Description
objectanyobject value

Returns

string | number

reference id or null if not found


getRegistry

▸ Abstract getRegistry(): Registry

Get registry of memento serializers

Returns

Registry


setObject

▸ Abstract setObject(value, type?): SerializationContext

Sets object to the current context (no child nodes for the object will be created in current context)

Parameters

Name Type Description
valueanyobject value
Optional typestringthe optional serialization type

Returns

SerializationContext


setValue

▸ Abstract setValue(value): SerializationContext

Sets value to the current context (no child nodes for the value will be created in current context)

Parameters

Name Type Description
valueanyobject value

Returns

SerializationContext