N - node value typeE - edge value typepublic final class GraphMLReader<N,E> extends Object implements GraphReader<N,E>
| Constructor and Description |
|---|
GraphMLReader(XMLReader xmlReader)
Create a new GraphML reader with the specified XML reader.
|
| Modifier and Type | Method and Description |
|---|---|
Graph<N,E> |
read(File file)
Read a graph from the specified file.
|
Graph<N,E> |
read(InputStream inputStream)
Read a graph from the specified input stream.
|
Graph<N,E> |
read(URL url)
Read a graph from the specified URL.
|
void |
setEdgeValueHandler(StAXContentHandler edgeValueHandler)
Set the edge value handler for this GraphML reader to
edgeValueHandler. |
void |
setNodeValueHandler(StAXContentHandler nodeValueHandler)
Set the node value handler for this GraphML reader to
nodeValueHandler. |
public GraphMLReader(XMLReader xmlReader)
xmlReader - XML reader, must not be nullpublic void setNodeValueHandler(StAXContentHandler nodeValueHandler)
nodeValueHandler.
The specified node value handler will be delegated to with the XML subtree within the
<node> element, typically with one or more <data>
elements.
nodeValueHandler - node value handlerpublic void setEdgeValueHandler(StAXContentHandler edgeValueHandler)
edgeValueHandler.
The specified edge value handler will be delegated to with the XML subtree within the
<edge> element, typically with one or more <data>
elements.
edgeValueHandler - edge value handlerpublic Graph<N,E> read(File file) throws IOException
read in interface GraphReader<N,E>file - file to read from, must not be nullIOException - if an IO error occurspublic Graph<N,E> read(InputStream inputStream) throws IOException
read in interface GraphReader<N,E>inputStream - input stream to read from, must not be nullIOException - if an IO error occurspublic Graph<N,E> read(URL url) throws IOException
read in interface GraphReader<N,E>url - URL to read from, must not be nullIOException - if an IO error occursCopyright (c) 2008-2013 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).