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 KryoMapper.Builder |
kryoMapper()
By default, this method creates an instance of the most current version of
KryoMapper which is
used to serialize data to and from the graph. |
default KryoReader.Builder |
kryoReader()
Creates a
GraphReader builder for Kryo serializations. |
default KryoWriter.Builder |
kryoWriter()
Creates a
GraphWriter builder for Kryo serializations. |
void |
readGraphML(java.lang.String file)
Read a GraphML file using the default configuration of the
GraphMLReader. |
void |
readGraphSON(java.lang.String file)
Read a GraphSON file using the default configuration of the
GraphSONReader. |
void |
readKryo(java.lang.String file)
Read a kryo file using the default configuration of the
KryoReader. |
void |
writeGraphML(java.lang.String file)
Write a GraphML file using the default configuration of the
GraphMLWriter. |
void |
writeGraphSON(java.lang.String file)
Write a GraphSON file using the default configuration of the
GraphSONWriter. |
void |
writeKryo(java.lang.String file)
Write a kryo file using the default configuration of the
KryoWriter. |
default KryoReader.Builder kryoReader()
GraphReader builder for Kryo serializations. This
method calls the kryoMapper() method to supply to
KryoReader.Builder.mapper(com.tinkerpop.gremlin.structure.io.kryo.KryoMapper) which means that implementers
should usually just override kryoMapper() to append in their mapper classes.default KryoWriter.Builder kryoWriter()
GraphWriter builder for Kryo serializations. This
method calls the kryoMapper() method to supply to
KryoWriter.Builder.mapper(com.tinkerpop.gremlin.structure.io.kryo.KryoMapper) which means that implementers
should usually just override kryoMapper() to append in their mapper classes.void writeKryo(java.lang.String file)
throws java.io.IOException
KryoWriter.java.io.IOExceptionvoid readKryo(java.lang.String file)
throws java.io.IOException
KryoReader.java.io.IOExceptiondefault KryoMapper.Builder kryoMapper()
KryoMapper 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 KryoMapper.
KryoMapper 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 KryoMapper
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(java.lang.String file)
throws java.io.IOException
GraphMLWriter.java.io.IOExceptionvoid readGraphML(java.lang.String file)
throws java.io.IOException
GraphMLReader.java.io.IOExceptiondefault 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(java.lang.String file)
throws java.io.IOException
GraphSONWriter.java.io.IOExceptionvoid readGraphSON(java.lang.String file)
throws java.io.IOException
GraphSONReader.java.io.IOExceptiondefault 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 TinkerPop. All Rights Reserved.