Last updated

API / geotoolkit / persistence / MementoDeserializationContext / MementoDeserializationContext

Class: MementoDeserializationContext

persistence.MementoDeserializationContext.MementoDeserializationContext

The deserialization context to Memento

Hierarchy

Table of contents

Constructors
Methods

Contents

Constructors

new MementoDeserializationContext(memento, registry)

new MementoDeserializationContext(memento?, registry?)

Parameters

Name Type
Optional mementoany
Optional registryRegistry

Overrides

DeserializationContext.constructor

Methods

addReference

addReference(id, reference): void

Register instance of the object

Parameters

Name Type Description
idstringunique id of the object
referenceanyinstance of the deserialised class

Returns

void

Overrides

DeserializationContext.addReference


getCurrentObject

getCurrentObject(): any

Return the current object on the stack

Returns

any

Overrides

DeserializationContext.getCurrentObject


getMemento

getMemento(): any

Gets memento associated with context

Returns

any


getObject

getObject(type?, name?, dest?): any

Get object

Parameters

Name Type Description
Optional typestringtype of the object
Optional namestringname of the property
Optional destany

Returns

any

value

Overrides

DeserializationContext.getObject


getOptions

getOptions(): Options

Returnы deserialization ooptions

Returns

Options

deserialization ooptions

Overrides

DeserializationContext.getOptions


getReference

getReference(id): any

Get object by reference

Parameters

Name Type Description
idstringreference id

Returns

any

Overrides

DeserializationContext.getReference


getRegistry

getRegistry(): Registry

Get registry of memento deserializers

Returns

Registry

Overrides

DeserializationContext.getRegistry


getValue

getValue(name?, type?, dest?): any

Get value

Parameters

Name Type Description
Optional namestringname of the property
Optional typestringoptional type
Optional destanydestination object

Returns

any

value

Overrides

DeserializationContext.getValue


popCurrentObject

popCurrentObject(): any

Pop the current object from the stack

Returns

any

Overrides

DeserializationContext.popCurrentObject


pushCurrentObject

pushCurrentObject(object): void

Push the current deserialized object. This method can be used if it is necessary to provide the existing object for deserialization

Parameters

Name Type Description
objectanyinstance of the deserialised class

Returns

void

Overrides

DeserializationContext.pushCurrentObject


queryChildren

queryChildren(callback, propertyName?): void

Enumerate each child property

Parameters

Name Type Description
callback(property: string, context: MementoDeserializationContext) => voidfunction called by each object child
Optional propertyNamestringoptional property name

Returns

void

Overrides

DeserializationContext.queryChildren


requestObject

requestObject(id, callback): void

Request object

Parameters

Name Type Description
idstringunique id of the object
callback(value: any) => voidfunction contains parameter object that can be requested

Returns

void

Overrides

DeserializationContext.requestObject


setOptions

setOptions(options): MementoDeserializationContext

Set deserialization options

Parameters

Name Type Description
optionsOptionsdeserialization options

Returns

MementoDeserializationContext

this