public final class GraphMLIo extends Object implements Io<GraphMLReader.Builder,GraphMLWriter.Builder,GraphMLMapper.Builder>
Graph
and IoRegistry
. Implementers of the Graph
interfaces do not have to register any special serializers to the IoRegistry
as GraphML does not support
such things.Modifier and Type | Class and Description |
---|---|
static class |
GraphMLIo.Builder |
Io.Exceptions
Modifier and Type | Method and Description |
---|---|
static Io.Builder<GraphMLIo> |
build() |
GraphMLMapper.Builder |
mapper()
Constructs a
Mapper.Builder which is responsible for constructing the abstraction over different
serialization methods. |
GraphMLReader.Builder |
reader()
Creates a
GraphReader.ReaderBuilder implementation . |
void |
readGraph(String file)
Read a
Graph from file using the default configuration of the Io.reader() and its supplied
Io.mapper() . |
void |
writeGraph(String file)
Write a
Graph to file using the default configuration of the Io.writer() and its supplied
Io.mapper() . |
GraphMLWriter.Builder |
writer()
Creates a
GraphWriter.WriterBuilder implementation . |
public GraphMLReader.Builder reader()
GraphReader.ReaderBuilder
implementation . Implementers should call the
Io.mapper()
function to feed its result to the builder. In this way, custom class serializers
registered to the Mapper.Builder
by Graph
implementations will end up being used for
the serialization process.reader
in interface Io<GraphMLReader.Builder,GraphMLWriter.Builder,GraphMLMapper.Builder>
public GraphMLWriter.Builder writer()
GraphWriter.WriterBuilder
implementation . Implementers should call the
Io.mapper()
function to feed its result to the builder. In this way, custom class serializers
registered to the Mapper.Builder
by Graph
implementations will end up being used for
the serialization process.writer
in interface Io<GraphMLReader.Builder,GraphMLWriter.Builder,GraphMLMapper.Builder>
public GraphMLMapper.Builder mapper()
Mapper.Builder
which is responsible for constructing the abstraction over different
serialization methods. Implementations should set defaults as required, but most importantly need to
make the appropriate call to Mapper.Builder.addRegistry(IoRegistry)
which will provide the
builder with any required custom serializers of the Graph
.mapper
in interface Io<GraphMLReader.Builder,GraphMLWriter.Builder,GraphMLMapper.Builder>
public void writeGraph(String file) throws IOException
Graph
to file using the default configuration of the Io.writer()
and its supplied
Io.mapper()
.writeGraph
in interface Io<GraphMLReader.Builder,GraphMLWriter.Builder,GraphMLMapper.Builder>
IOException
public void readGraph(String file) throws IOException
Graph
from file using the default configuration of the Io.reader()
and its supplied
Io.mapper()
.readGraph
in interface Io<GraphMLReader.Builder,GraphMLWriter.Builder,GraphMLMapper.Builder>
IOException
public static Io.Builder<GraphMLIo> build()
Copyright © 2013–2016 Apache Software Foundation. All rights reserved.