Interface that provides the context of a GraphML write process.
Remarks
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.graphml.IWriteContext
See Also
Properties
Gets the currently active graph object
Gets the current nesting of graphs and graph elements.
Remarks
Gets an implementation of IWriteEvents that allows to subscribe to various events in the write process.
Gets the current IXmlWriter implementation.
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
- The desired target type.
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
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
$class
property on JavaScript classes inheriting from yFiles classes is only valid once an instance of this subclass was created. Call fixType, first or instantiate the class at least once.Defined in
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.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.Serialize item
to an XML representation.
Remarks
context
instance is used.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.
- context - IWriteContext
- The current write context.
- item - T
- The object that should be serialized.
Throws
- Exception({ name: 'SerializationNotSupportedError' })
See Also
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.