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-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.graphml.IParseContext
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.
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 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 - Class
- 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 - Class
- 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 - Class
- The desired target type.
Returns
- ↪T
- the most current element within the container hierarchy or
default(T)
.
See Also
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 in order 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 reobtained for subsequent use.Type Parameters
- T: any
Parameters
options - Object
A map of options to pass to the method.
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
Note that the
$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.