Interface that defines the context of a GraphML parsing context.
Remarks
All state data that is needed for the parsing of a concrete input should go here, allowing all handlers and deserializers to be implemented stateless.
Type Details
- yFiles module
- view
Properties
Gets the currently active graph object.
Gets the current nesting of created graphs and graph elements.
Remarks
The list contains the user objects which correspond to the GraphML elements which are ancestors of the current node in the DOM tree.
Property Value
A read-only view on the current nesting
Gets an implementation of IParseEvents that allows to subscribe to various events in the parse process.
Methods
Deserialize the object representation in targetNode
.
Remarks
This method calls deserializeCore with
context
as the first argument and should be used in virtually all cases.Type Parameters
- T
- The desired target type.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- targetType - Constructor<T>
- The desired target type.
- targetNode - Node
- The XML node that should be deserialized.
Returns
- ↪T?
- an instance of
T
ornull
.
Throws
- Exception({ name: 'DeserializationNotSupportedError' })
See Also
Deserialize the object representation in targetNode
Remarks
Client code should usually use the method deserialize instead to ensure the correct
context
instance is used.Type Parameters
- T
- The expected return type.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- targetType - Constructor<T>
- The expected return type.
- context - IParseContext
- The current parse context.
- targetNode - Node
- The XML node that should be deserialized.
Returns
- ↪T?
- The deserialized object from
targetNode
or an DeserializationNotSupportedError iftargetNode
could not be deserialized.
See Also
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
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- itemType - Constructor<T>
- The desired target type.
Returns
- ↪T?
- The most current element within the container hierarchy or
default(T)
.
Get a property value that specifies information about how to handle specific cases.
Parameters
options - Object
A map of options to pass to the method.
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.
Returns an instance that implements the given type or null
.
Remarks
Typically, 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.Type Parameters
- T
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- type - Constructor<T>
- the type for which an instance shall be returned
Returns
- ↪T?
- an instance that is assignable to the type or
null