Class GraphSONIo
java.lang.Object
org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONIo
- All Implemented Interfaces:
Io<GraphSONReader.Builder,GraphSONWriter.Builder, GraphSONMapper.Builder>
public final class GraphSONIo
extends Object
implements Io<GraphSONReader.Builder,GraphSONWriter.Builder,GraphSONMapper.Builder>
Constructs GraphSON IO implementations given a
Graph and IoRegistry. Implementers of the Graph
interfaces should see the GraphSONMapper for information on the expectations for the IoRegistry.- Author:
- Stephen Mallette (http://stephen.genoprime.com)
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.structure.io.Io
Io.Exceptions -
Method Summary
Modifier and TypeMethodDescriptionstatic Io.Builder<GraphSONIo>build()Create a new builder using the default version of GraphSON - v3.static Io.Builder<GraphSONIo>build(GraphSONVersion version) Create a new builder using the specified version of GraphSON.mapper()Constructs aMapper.Builderwhich is responsible for constructing the abstraction over different serialization methods.reader()Creates aGraphReader.ReaderBuilderimplementation .voidRead aGraphfrom file using the default configuration of theIo.reader()and its suppliedIo.mapper().voidwriteGraph(String file) Write aGraphto file using the default configuration of theIo.writer()and its suppliedIo.mapper().writer()Creates aGraphWriter.WriterBuilderimplementation .
-
Method Details
-
reader
Creates aGraphReader.ReaderBuilderimplementation . Implementers should call theIo.mapper()function to feed its result to the builder. In this way, custom class serializers registered to theMapper.BuilderbyGraphimplementations will end up being used for the serialization process.- Specified by:
readerin interfaceIo<GraphSONReader.Builder,GraphSONWriter.Builder, GraphSONMapper.Builder>
-
writer
Creates aGraphWriter.WriterBuilderimplementation . Implementers should call theIo.mapper()function to feed its result to the builder. In this way, custom class serializers registered to theMapper.BuilderbyGraphimplementations will end up being used for the serialization process.- Specified by:
writerin interfaceIo<GraphSONReader.Builder,GraphSONWriter.Builder, GraphSONMapper.Builder>
-
mapper
Constructs aMapper.Builderwhich 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 toMapper.Builder.addRegistry(IoRegistry)which will provide the builder with any required custom serializers of theGraph.- Specified by:
mapperin interfaceIo<GraphSONReader.Builder,GraphSONWriter.Builder, GraphSONMapper.Builder>
-
writeGraph
Write aGraphto file using the default configuration of theIo.writer()and its suppliedIo.mapper().- Specified by:
writeGraphin interfaceIo<GraphSONReader.Builder,GraphSONWriter.Builder, GraphSONMapper.Builder> - Throws:
IOException
-
readGraph
Read aGraphfrom file using the default configuration of theIo.reader()and its suppliedIo.mapper().- Specified by:
readGraphin interfaceIo<GraphSONReader.Builder,GraphSONWriter.Builder, GraphSONMapper.Builder> - Throws:
IOException
-
build
Create a new builder using the default version of GraphSON - v3. -
build
Create a new builder using the specified version of GraphSON.
-