An IWriteContext implementation for use in the context of GraphMLWriter that wraps a given instance and delegates most of the calls to it but allows for modifying lookup and serialization properties.
Remarks
Type Details
- yfiles module
- view-graphml
- yfiles-umd modules
- view-graphml, view
- Legacy UMD name
- yfiles.graphml.ChildWriteContext
Constructors
Initializes a new instance of the ChildWriteContext class that delegates to the provided context and returns the given value in getCurrent.
Parameters
A map of options to pass to the method.
- parentContext - IWriteContext
- The parent context to delegate calls to.
- currentObject - Object
- The current object to return in getCurrent.
Initializes a new instance of the ChildWriteContext class that delegates to the given parent context.
Parameters
A map of options to pass to the method.
- parentContext - IWriteContext
- The parent context.
Properties
Gets the currently active graph object
Implements
Gets the current nesting of graphs and graph elements.
Remarks
Implements
Gets the parent context to which most calls are delegated.
Gets an implementation of IWriteEvents that allows to subscribe to various events in the write process.
Implements
Gets or sets the writer.
Remarks
Implements
Methods
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.
Type Parameters
- T
Parameters
A map of options to pass to the method.
- itemType - Class
- The desired target type.
Returns
- ↪T
- the most current element within the container hierarchy or
default(T)
.
See Also
Implements
Get a property value that specifies information about how to handle specific cases
Parameters
A map of options to pass to the method.
- key - string
- The identifier for the property
Returns
- ↪any
- The property value, or
null
if no such property exists
Implements
Returns an instance that implements the given type or null
.
Remarks
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 reobtained for subsequent use.Type Parameters
- T: any
Parameters
A map of options to pass to the method.
- type - Class<T>
- The type for which an instance shall be returned.
Returns
- ↪T
- an instance that is assignable to type or
null
See Also
Implements
Removes a previously locally set serialization property.
Parameters
A map of options to pass to the method.
- key - string
- The key for which the local property override should be removed.
Serialize the item
.
Remarks
context
as first argument and should be used in virtually all cases.Type Parameters
- T
- The type of the object that is serialized.
Parameters
A map of options to pass to the method.
- targetType - Class
- The type of the object that is serialized.
- item - T
- The object that should be serialized.
Throws
- Exception({ name: 'SerializationNotSupportedError' })
See Also
Class.ensure(GraphMLSupport)
More information.Defined in
Serializes the specified item using the provided type information.
Remarks
item
should be assignable to type t
. This method simply delegates to serializeCore, using the correct type parameter.Parameters
A map of options to pass to the method.
- item - Object
- The item to serialize.
- t - Class
- The type the item is known to be of at deserialization time.
Class.ensure(GraphMLSupport)
More information.Defined in
Serialize item
to an XML representation.
Remarks
context
instance is used.Type Parameters
- T
Parameters
A map of options to pass to the method.
- targetType - Class
- 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
Implements
Serialize an replacement object replacement
instead of the original originalItem
.
Remarks
Type Parameters
- T
- The type of the object that is serialized.
Parameters
A map of options to pass to the method.
- targetType - Class
- originalItem - Object
- The original object that should be serialized.
- replacement - T
- The replacement object that will actually be serialized instead.
Throws
- Exception({ name: 'SerializationNotSupportedError' })
See Also
Class.ensure(GraphMLSupport)
More information.Defined in
Adds another lookup result to the local lookup override.
Type Parameters
- T
- The type to use as a key for the lookup.
Parameters
A map of options to pass to the method.
- tType - Class
- The type to use as a key for the lookup.
- value - T
- The value to provide for queries to
T
.