|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecty.io.IOHandler
yext.graphml.graph2D.GraphMLIOHandler
yext.graphml.compat.GraphMLLayoutGraphIOHandler
IOHandler for (de)serializing graphs from/to GraphML format.
GraphMLIOHandler supports (de)serialization of custom GraphML attributes that
hold data of simple type.
Such GraphML attributes with graph, node, or edge scope can be conveniently enabled
using one of the following methods addGraphAttribute,
addNodeAttribute, or addEdgeAttribute.
For more information about the GraphML file format please refer to the GraphML Primer.
| Field Summary |
| Fields inherited from class yext.graphml.graph2D.GraphMLIOHandler |
edgeOutputHandlers, graphmlOutputHandlers, graphOutputHandlers, ignoreGraphicsEnabled, inputHandlers, nodeOutputHandlers, portOutputHandlers, validationEnabled, writeDTDEnabled, writeXMLSchemaEnabled |
| Constructor Summary | |
GraphMLLayoutGraphIOHandler()
|
|
| Method Summary | |
protected DirectGraphMLWriter |
createDirectGraphMLWriter(Graph graph)
Creates and returns a GraphML writer instance. |
protected GraphElementFactory |
createGraphElementFactory(Graph graph)
Create the factory instance used for reading the graph |
protected GraphElementProvider |
createGraphElementProvider(Graph graph)
Create the provider instance used for writing the graph |
protected DOMGraphMLParser |
createParser(Graph graph)
|
boolean |
isAutoCreateGroupingDPs()
Returns whether data providers for grouping information should automatically be created and registered. |
void |
read(Graph graph,
InputStream is)
Reads a GraphML file from the given input stream and populates the Graph2D object. |
void |
read(Graph graph,
Node n)
Reads a Graph from a preparsed DOM tree object. |
void |
read(Graph graph,
String name)
Fills the contents of the given graph from a file. |
void |
read(Graph graph,
URL url)
Fills the contents of the given graph from a URL. |
void |
setAutoCreateGroupingDPs(boolean autoCreateGroupingDPs)
Sets whether data providers for grouping information should automatically be created and registered. |
void |
write(Graph graph,
OutputStream os)
Writes the given Graph2D object to the output stream creating a GraphML file. |
void |
write(Graph graph,
Result result)
Writes the given Graph2D object to a Transformer result. |
void |
write(Graph graph,
String name)
Writes the contents of the given graph to a file. |
void |
write(Graph graph,
Writer writer)
Writes the given Graph2D object to the output stream creating a GraphML file. |
| Methods inherited from class y.io.IOHandler |
canWriteSubset, createObjectInputStream, createObjectOutputStream, hide, read, read, shouldSerialize, shouldSerialize, write, writeSubset, writeSubset |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public GraphMLLayoutGraphIOHandler()
| Method Detail |
public boolean isAutoCreateGroupingDPs()
false.
setAutoCreateGroupingDPs(boolean),
GroupingKeys.GROUP_DPKEY,
GroupingKeys.NODE_ID_DPKEY,
GroupingKeys.PARENT_NODE_ID_DPKEYpublic void setAutoCreateGroupingDPs(boolean autoCreateGroupingDPs)
false.
Note: If this flag is set to true, DataProviders for the following keys will be automatically created and registered:
isAutoCreateGroupingDPs(),
GroupingKeys.GROUP_DPKEY,
GroupingKeys.NODE_ID_DPKEY,
GroupingKeys.PARENT_NODE_ID_DPKEY
public void write(Graph graph,
String name)
throws IOException
name - The name of the output file
IOException
public void write(Graph graph,
OutputStream os)
throws IOException
Note that the graph element provider that is used by the encoder logic to write
the GraphML file is chosen depending on whether the Graph2D object has a
HierarchyManager associated or not.
graph - The Graph2D object that is to be written to a GraphML file.os - The output stream that becomes the GraphML file.
IOExceptionYGraphElementProvider
public void write(Graph graph,
Writer writer)
throws IOException
Note that the graph element provider that is used by the encoder logic to write
the GraphML file is chosen depending on whether the Graph2D object has a
HierarchyManager associated or not.
graph - The Graph2D object that is to be written to a GraphML file.writer - The writer that becomes the GraphML file.
IOExceptionYGraphElementProvider,
YHierarchyGraphElementProvider
public void write(Graph graph,
Result result)
throws IOException
Note that the graph element provider that is used by the encoder logic to write
the GraphML file is chosen depending on whether the Graph2D object has a
HierarchyManager associated or not.
graph - The Graph2D object that is to be written to a GraphML file.result - The Transformer result that stores the output.
IOExceptionYGraphElementProvider,
YHierarchyGraphElementProviderprotected GraphElementProvider createGraphElementProvider(Graph graph)
createGraphElementProvider in class GraphMLIOHandlerprotected DirectGraphMLWriter createDirectGraphMLWriter(Graph graph)
GraphMLIOHandler
createDirectGraphMLWriter in class GraphMLIOHandler
public void read(Graph graph,
String name)
throws IOException
name - The name of the file to be read.
IOException
public void read(Graph graph,
URL url)
throws IOException
url - The url of the resource to be read.
IOException
public void read(Graph graph,
InputStream is)
throws IOException
Note that the graph element factory that is used by the parser logic to create
new graph elements (and eventually also new graphs) is chosen depending on
whether the Graph2D object has a HierarchyManager
associated or not.
graph - The Graph2D object that is to be populated with nodes and edges as read from
the GraphML file.is - The input stream that holds the GraphML file to be read.
IOExceptionYGraphElementFactory,
YHierarchyGraphElementFactory
public void read(Graph graph,
Node n)
throws IOException
Note that the graph element factory that is used by the parser logic to create
new graph elements (and eventually also new graphs) is chosen depending on
whether the Graph2D object has a HierarchyManager
associated or not.
This overload is useful if the IOHandler is used after a chain of TRaX transformations
graph - The Graph2D object that is to be populated with nodes and edges as read from
the GraphML file.n - The root node of the preparsed DOM tree.
IOExceptionYGraphElementFactory,
YHierarchyGraphElementFactoryprotected DOMGraphMLParser createParser(Graph graph)
createParser in class GraphMLIOHandlerprotected GraphElementFactory createGraphElementFactory(Graph graph)
createGraphElementFactory in class GraphMLIOHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||