API / geotoolkit / persistence / XmlSerializationContext / XmlSerializationContext
persistence.XmlSerializationContext.XmlSerializationContext
The serialization context to XML
↳
XmlSerializationContext
Methods
Constructors
• new XmlSerializationContext(doc, node?, registry?, owner?)
| Name | Type |
|---|---|
doc | Document |
Optional node | Node |
Optional registry | Registry |
Optional owner | any |
SerializationContext.constructor
Methods
▸ addObject(name, object, type?): XmlSerializationContext
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.
| Name | Type | Description |
|---|---|---|
name | string | unique property name |
object | any | object to be serialized |
Optional type | string | the optional serialization type |
SerializationContext.addObject
▸ addReference(obj): string | number
Add reference to the object
| Name | Type | Description |
|---|---|---|
obj | any | object to get reference |
string | number
id of the reference
SerializationContext.addReference
▸ addValue(name, value): void
Adds the specified value with name "name" to the current context
| Name | Type | Description |
|---|---|---|
name | string | unique property name |
value | any | object value |
void
▸ commit(): void
Commit changes
void
▸ createChild(name, type?): XmlSerializationContext
Create child element in the current context
| Name | Type | Description |
|---|---|---|
name | string | unique property name |
Optional type | string | type of the object |
SerializationContext.createChild
▸ getNode(): Node
Return a result of the serialization to Node
Node
▸ getOptions(): Options
Returnы serialization ooptions
serialization ooptions
SerializationContext.getOptions
▸ getReferenceId(obj): string | number
Get reference id for the specified object. Null as return value means that the object was not saved before
| Name | Type | Description |
|---|---|---|
obj | any | object value |
string | number
reference id or null if not found
SerializationContext.getReferenceId
▸ getRegistry(): Registry
Get registry of memento serializers
SerializationContext.getRegistry
▸ setObject(object, type?): XmlSerializationContext
Sets object to the current context (no child nodes for the object will be created in current context)
| Name | Type | Description |
|---|---|---|
object | any | object value |
Optional type | string | the optional serialization type |
SerializationContext.setObject
▸ setOptions(options): XmlSerializationContext
Set serialization options
| Name | Type | Description |
|---|---|---|
options | Options | serialization options |
this
▸ setValue(value): XmlSerializationContext
Sets value to the current context (no child nodes for the value will be created in current context)
| Name | Type | Description |
|---|---|---|
value | any | object value |