Core parser class for GraphML.
Remarks
readFrom
methods which calls one of the various GraphMLParser.parseFrom
method variants. It should rarely be necessary to use this class directly.Type Details
- yfiles module
- view-graphml
- yfiles-umd modules
- view-graphml, view
- Legacy UMD name
- yfiles.graphml.GraphMLParser
See Also
Methods
Create the initial IParseContext instance.
Parameters
A map of options to pass to the method.
- graph - IGraph
- The graph that is parsed.
Returns
- ↪IParseContext
- An IParseContext instance that is suitable for
graph
.
Deserialize the content of element
.
Remarks
Type Parameters
- T
- The desired type of the result.
Parameters
A map of options to pass to the method.
- targetType - Class
- The desired type of the result.
- context - IParseContext
- The current parse context.
- element - Node
- The XML content that should be deserialized.
Returns
- ↪T
- An instance of
T
that is represented byelement
.
See Also
Retrieve a deserialization property that has been set by setDeserializationProperty.
Parameters
A map of options to pass to the method.
- key - string
- The key for the property.
See Also
Dynamically retrieve all IInputHandler instances that process a GraphML attribute with key definition keyDefinition
.
Remarks
Parameters
A map of options to pass to the method.
- context - IParseContext
- The current parse context.
- keyDefinition - Element
- The key definition element of the GraphML attribute.
Returns
- ↪IList<IInputHandler>
- A list of IInputHandlers that claim to be responsible for handling the given GraphML attribute.
Fires the HandleDeserialization event.
Parameters
A map of options to pass to the method.
- evt - HandleDeserializationEventArgs
- The arguments that get passed to the HandleDeserialization event.
See Also
Raises the Parsed event.
Remarks
Parameters
A map of options to pass to the method.
- evt - ParseEventArgs
- The ParseEventArgs instance containing the event data.
See Also
Raises the Parsing event.
Remarks
Parameters
A map of options to pass to the method.
- evt - ParseEventArgs
- The ParseEventArgs instance containing the event data.
See Also
Fires the QueryInputHandlers event.
Parameters
A map of options to pass to the method.
- evt - QueryInputHandlersEventArgs
- The arguments that get passed to the QueryInputHandlers event.
See Also
parseFromDocument
(graph: IGraph, document: Document, elementFactory: IGraphElementFactory) : Promise<IGraph>Parse the XML document document
into an graph
instance, using elementFactory
to create the elements.
Remarks
Parameters
A map of options to pass to the method.
- graph - IGraph
- The graph instance that is populated.
- document - Document
- The XML document instance to parse. Note: If you are using Internet Explorer 9 and XMLHttpRequests to retrieve the document, you may not use the value from the XMLHttpRequest.responseXML property. Please parse XMLHttpRequest.responseText instead and use the result. For further reference see https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/compatibility/hh180177(v=vs.85).
- elementFactory - IGraphElementFactory
- The IGraphElementFactory instance that is used to create the elements.
See Also
Parse the input url
into an graph
instance, using elementFactory
to create the elements.
Remarks
Parameters
A map of options to pass to the method.
- graph - IGraph
- The graph instance that is populated.
- url - string
- The URL to the input to parse.
- elementFactory - IGraphElementFactory
- The IGraphElementFactory instance that is used to create the elements.
See Also
Remove a deserialization property that has been set by setDeserializationProperty.
Parameters
A map of options to pass to the method.
- key - string
- The key for the property.
See Also
Set a deserialization property that allows to fine tune the parsing process.
Parameters
A map of options to pass to the method.
- key - string
- The key for the property.
- value - Object
- The property value.
See Also
Events
Occurs when XML content is about to be deserialized.
Remarks
Subscribe to this event to provide custom deserialization handling for XML content.
The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called earlier.
The current XML content is provided by xmlNode. If you want to return deserialized content, set the value of the result property.
See Also
Event Registration
addHandleDeserializationListener(function(this, HandleDeserializationEventArgs):void)
Event Deregistration
removeHandleDeserializationListener(function(this, HandleDeserializationEventArgs):void)
Signature Details
function(sender: this, evt: HandleDeserializationEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - HandleDeserializationEventArgs
- An object that contains the event data.
Occurs when the document has been parsed.
See Also
Event Registration
addParsedListener(function(this, ParseEventArgs):void)
Event Deregistration
removeParsedListener(function(this, ParseEventArgs):void)
Signature Details
function(sender: this, evt: ParseEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - ParseEventArgs
- An object that contains the event data.
Occurs when the parsing of the document is just about to begin.
Remarks
See Also
Event Registration
addParsingListener(function(this, ParseEventArgs):void)
Event Deregistration
removeParsingListener(function(this, ParseEventArgs):void)
Signature Details
function(sender: this, evt: ParseEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - ParseEventArgs
- An object that contains the event data.
Occurs when IInputHandlers are queried.
Remarks
Subscribe to this event to dynamically register one or more IInputHandler instance(s) for a given GraphML attribute key definition.
The current key definition is provided by keyDefinition. If you want to register an IInputHandler for this GraphML attribute, you can add the handler with addInputHandler.
See Also
Event Registration
addQueryInputHandlersListener(function(this, QueryInputHandlersEventArgs):void)
Event Deregistration
removeQueryInputHandlersListener(function(this, QueryInputHandlersEventArgs):void)
Signature Details
function(sender: this, evt: QueryInputHandlersEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - QueryInputHandlersEventArgs
- An object that contains the event data.