public static interface Graph.Io
GraphReader
and GraphWriter
implementations (i.e. to register mapper
serialization classes).Modifier and Type | Method and Description |
---|---|
default GraphMLReader.Builder |
graphMLReader()
Creates a
GraphReader builder for GraphML serializations. |
default GraphMLWriter.Builder |
graphMLWriter()
Creates a
GraphWriter builder for GraphML serializations. |
default GraphSONMapper.Builder |
graphSONMapper()
By default, this method creates an instance of the most current version of
GraphSONMapper.Builder which is can produce a
Mapper implementation for GraphSON to
serialize data to and from the graph. |
default GraphSONReader.Builder |
graphSONReader()
Creates a
GraphReader builder for GraphSON serializations. |
default GraphSONWriter.Builder |
graphSONWriter()
Creates a
GraphWriter builder for GraphML serializations. |
default GryoMapper.Builder |
gryoMapper()
By default, this method creates an instance of the most current version of
GryoMapper which is
used to serialize data to and from the graph. |
default GryoReader.Builder |
gryoReader()
Creates a
GraphReader builder for Gryo serializations. |
default GryoWriter.Builder |
gryoWriter()
Creates a
GraphWriter builder for Gryo serializations. |
void |
readGraphML(String file)
Read a GraphML file using the default configuration of the
GraphMLReader . |
void |
readGraphSON(String file)
Read a GraphSON file using the default configuration of the
GraphSONReader . |
void |
readGryo(String file)
Read a gryo file using the default configuration of the
GryoReader . |
void |
writeGraphML(String file)
Write a GraphML file using the default configuration of the
GraphMLWriter . |
void |
writeGraphSON(String file)
Write a GraphSON file using the default configuration of the
GraphSONWriter . |
void |
writeGryo(String file)
Write a gryo file using the default configuration of the
GryoWriter . |
default GryoReader.Builder gryoReader()
GraphReader
builder for Gryo serializations. This
method calls the gryoMapper()
method to supply to
GryoReader.Builder.mapper(org.apache.tinkerpop.gremlin.structure.io.gryo.GryoMapper)
which means that implementers
should usually just override gryoMapper()
to append in their mapper classes.default GryoWriter.Builder gryoWriter()
GraphWriter
builder for Gryo serializations. This
method calls the gryoMapper()
method to supply to
GryoWriter.Builder.mapper(org.apache.tinkerpop.gremlin.structure.io.gryo.GryoMapper)
which means that implementers
should usually just override gryoMapper()
to append in their mapper classes.void writeGryo(String file) throws IOException
GryoWriter
.IOException
void readGryo(String file) throws IOException
GryoReader
.IOException
default GryoMapper.Builder gryoMapper()
GryoMapper
which is
used to serialize data to and from the graph. Implementers with mapper classes (e.g. a non-primitive
class returned from Element.id()
) should override this method with those classes automatically
registered to the returned GryoMapper
.
GryoMapper
will not be readable without this serializer configuration. It is
considered good practice to make serialization classes generally available so that users may
register these classes themselves if necessary when building up a mapper GryoMapper
instance.
default GraphMLReader.Builder graphMLReader()
GraphReader
builder for GraphML serializations. GraphML
is the most portable of all the formats, but comes at the price of the least flexibility.
Graph
implementations that have mapper classes that need to be serialized will not be able
to properly use this format effectively.default GraphMLWriter.Builder graphMLWriter()
GraphWriter
builder for GraphML serializations. GraphML
is the most portable of all the formats, but comes at the price of the least flexibility.
Graph
implementations that have mapper classes that need to be serialized will not be able
to properly use this format effectively.void writeGraphML(String file) throws IOException
GraphMLWriter
.IOException
void readGraphML(String file) throws IOException
GraphMLReader
.IOException
default GraphSONReader.Builder graphSONReader()
GraphReader
builder for GraphSON serializations.
GraphSON is forgiving for implementers and will typically do a "reasonable" job in serializing most
mapper classes. This method by default uses the GraphSONMapper
created by
graphSONMapper()
. That method enables implementers to register mapper serialization
modules for classes that do not serialize nicely by the default JSON serializers or completely
fail to do so.default GraphSONWriter.Builder graphSONWriter()
GraphWriter
builder for GraphML serializations.
GraphSON is forgiving for implementers and will typically do a "reasonable" job in serializing most
mapper classes. This method by default uses the GraphSONMapper
created by
graphSONMapper()
. That method enables implementers to register mapper serialization
modules for classes that do not serialize nicely by the default JSON serializers or completely
fail to do so.void writeGraphSON(String file) throws IOException
GraphSONWriter
.IOException
void readGraphSON(String file) throws IOException
GraphSONReader
.IOException
default GraphSONMapper.Builder graphSONMapper()
GraphSONMapper.Builder
which is can produce a
Mapper
implementation for GraphSON to
serialize data to and from the graph. Implementers with custom classes (e.g. a
non-primitive class returned from Element.id()
) should override this method with serialization
modules added.
GraphSONMapper
instance.
GraphSONMapper.Builder
with default configuration
for the current Graph
. Users can adjust and override such settings by altering the builder
settings.Copyright © 2013–2015 Apache Software Foundation. All rights reserved.