Interface that provides the context of a GraphML write process.
Implements
- I
Remarks
All state data that is needed for the writing of a concrete graph instance should go here, allowing all handlers and deserializers to be implemented stateless.
See Also
Developer's Guide
Members
Show:
Properties
Gets the currently active graph object.
Gets the currently active graph object.
readonlyabstract
Implemented in
ChildWriteContext.graphGets the current nesting of graphs and graph elements.
Gets the current nesting of graphs and graph elements.
The list contains the user objects which correspond to the GraphML elements.
readonlyabstract
Property Value
A read-only view on the current nesting
Implemented in
ChildWriteContext.objectStackGets an implementation of IWriteEvents that allows to subscribe to various events in the write process.
Gets an implementation of IWriteEvents that allows to subscribe to various events in the write process.
readonlyabstract
Implemented in
ChildWriteContext.writeEventsGets the current IXmlWriter implementation.
Gets the current IXmlWriter implementation.
readonlyabstract
Implemented in
ChildWriteContext.writerMethods
Returns the most current (the last element) within the container hierarchy as it is returned by objectStack or default(T) if the most current element is not of the desired target type.
Returns the most current (the last element) within the container hierarchy as it is returned by objectStack or
default(T) if the most current element is not of the desired target type.abstract
Parameters
- itemType: Constructor<T>
- The desired target type.
Return Value
- T
- The most current element within the container hierarchy or
default(T).
See Also
Developer's Guide
Implemented in
ChildWriteContext.getCurrentabstract
Parameters
- key: string
- The identifier for the property
Return Value
- any
- The property value, or
nullif no such property exists
Implemented in
ChildWriteContext.getSerializationPropertyTypically, this method will be called to obtain a different view or aspect of the current instance. This is quite similar to casting or using a super type or interface of this instance, but is not limited to inheritance or compile-time constraints. An instance implementing this method is not required to return non-
null implementations for the types, nor does it have to return the same instance any time. Also, it depends on the type and context whether the instance returned stays up to date or needs to be re-obtained for further use.abstract
Parameters
- type: Constructor<T>
- the type for which an instance shall be returned
Return Value
- T
- an instance that is assignable to the type or
null
See Also
Developer's Guide
Defined in
ILookup.lookupThis method calls serializeCore with
context as first argument and should be used in virtually all cases.Parameters
- targetType: Constructor<T>
- The type of the object that is serialized.
- item: T
- The object that should be serialized.
Throws
- Exception ({ name: 'SerializationNotSupportedError' })
See Also
Developer's Guide
API
- serializeCore
item should be assignable to type t. This method simply delegates to serializeCore, using the correct type parameter.Parameters
- item: any
- The item to serialize.
- t: Constructor
- The type the item is known to be of at deserialization time.
Serialize item to an XML representation.
Serialize
item to an XML representation.Client code should usually use the method serialize instead to ensure the correct
context instance is used.abstract
Parameters
- targetType: Constructor<T>
- The type of the object that is serialized.
- context: IWriteContext
- The current write context.
- item: T
- The object that should be serialized.
Throws
- Exception ({ name: 'SerializationNotSupportedError' })
See Also
API
- serialize
Implemented in
ChildWriteContext.serializeCoreCalling this method allows remembering the original object instance, even if the object is actually written through a MarkupExtension or similar replacement mechanisms.
Parameters
- targetType: Constructor<T>
- originalItem: any
- The original object that should be serialized.
- replacement: T
- The replacement object that will actually be serialized instead.
Throws
- Exception ({ name: 'SerializationNotSupportedError' })