Search this API

y.io.graphml.input
Interface GraphMLParseContext

All Superinterfaces:
Lookup
All Known Implementing Classes:
ChildParseContext

public interface GraphMLParseContext
extends Lookup

Interface that defines the context of a GraphML parsing context.

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

 

Method Summary
 java.lang.Object deserialize(GraphMLParseContext context, org.w3c.dom.Node targetNode, java.lang.Class targetType)
          Deserialize the Object representation in targetNode.
 java.lang.Object deserialize(org.w3c.dom.Node targetNode)
          Deserialize the Object representation in targetNode.
 java.lang.Object getCurrentObject()
          Returns the most current (i.e. the last element) within the container hierarchy as it is returned by getObjectStack()
 java.lang.Object getDeserializationProperty(java.lang.Object key)
          Get a property value that specifies information about how to handle specific cases.
 Graph getGraph()
          Returns the currently active graph object.
 java.util.Collection getObjectStack()
          Returns the current nesting of graphs and graph elements.
 ParseEventHandler getParseEvents()
          Returns an implementation of ParseEventHandler that allows to subscribe to various events in the parse process.
 
Methods inherited from interface y.io.graphml.Lookup
lookup
 

Method Detail

getObjectStack

java.util.Collection getObjectStack()
Returns the current nesting of graphs and graph elements.

The list contains the user objects which correspond to the graphml elements which are ancestors of the current node in the DOM tree. The list is appended to at the start, i.e. the most current element is at list index 0.

Returns:
A view on the current nesting.

getCurrentObject

java.lang.Object getCurrentObject()
Returns the most current (i.e. the last element) within the container hierarchy as it is returned by getObjectStack()

Returns:
The current graph element in the container hierarchy.

getParseEvents

ParseEventHandler getParseEvents()
Returns an implementation of ParseEventHandler that allows to subscribe to various events in the parse process.

Returns:
A ParseEventHandler implementation.

getGraph

Graph getGraph()
Returns the currently active graph object.

Returns:
The current graph object.

getDeserializationProperty

java.lang.Object getDeserializationProperty(java.lang.Object key)
Get a property value that specifies information about how to handle specific cases.

Parameters:
key - The identifier for the property
Returns:
The property value, or null if no such property exists

deserialize

java.lang.Object deserialize(GraphMLParseContext context,
                             org.w3c.dom.Node targetNode,
                             java.lang.Class targetType)
                             throws GraphMLParseException
Deserialize the Object representation in targetNode.

This method is reserved for special use cases. Usually, you should just call deserialize(Node) instead.

Parameters:
context - The current parse context.
targetNode - The XML node that should be deserialized.
targetType - The type the result is expected to have, or null if deserialization handlers should determine this information automatically.
Returns:
The deserialized object from targetNode
Throws:
GraphMLParseException

deserialize

java.lang.Object deserialize(org.w3c.dom.Node targetNode)
                             throws GraphMLParseException
Deserialize the Object representation in targetNode.

Parameters:
targetNode - The XML node that should be deserialized.
Returns:
The deserialized object from targetNode
Throws:
GraphMLParseException

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.