public class GraphSONWriter extends Object implements GraphWriter
Map objects do not support complex types for keys. Edge and
Vertex objects are serialized to Map instances. If an
Element is used as a key, it is coerced to its identifier. Other complex
objects are converted via Object.toString() unless a mapper serializer is supplied.| Modifier and Type | Class and Description |
|---|---|
static class |
GraphSONWriter.Builder |
| Modifier and Type | Method and Description |
|---|---|
static GraphSONWriter.Builder |
build() |
void |
writeEdge(OutputStream outputStream,
Edge e)
Write an edge to a stream.
|
void |
writeGraph(OutputStream outputStream,
Graph g)
Write the entire graph to a stream.
|
void |
writeVertex(OutputStream outputStream,
Vertex v)
Write a vertex to a stream without writing its edges.
|
void |
writeVertex(OutputStream outputStream,
Vertex v,
Direction direction)
Write a vertex to a stream with its associated edges.
|
void |
writeVertices(OutputStream outputStream,
Traversal<?,Vertex> traversal)
Write a vertex to a stream without writing its edges.
|
void |
writeVertices(OutputStream outputStream,
Traversal<?,Vertex> traversal,
Direction direction)
Write a list of vertices from a
Traversal to a stream with its associated edges. |
public void writeGraph(OutputStream outputStream, Graph g) throws IOException
GraphWriterwriteGraph in interface GraphWriterIOExceptionpublic void writeVertex(OutputStream outputStream, Vertex v, Direction direction) throws IOException
GraphWriterwriteVertex in interface GraphWriteroutputStream - The stream to write to.v - The vertex to write.direction - If direction is null then no edges are written.IOExceptionpublic void writeVertex(OutputStream outputStream, Vertex v) throws IOException
GraphWriterwriteVertex in interface GraphWriteroutputStream - The stream to write to.v - The vertex to write.IOExceptionpublic void writeEdge(OutputStream outputStream, Edge e) throws IOException
GraphWriterwriteEdge in interface GraphWriterIOExceptionpublic void writeVertices(OutputStream outputStream, Traversal<?,Vertex> traversal, Direction direction) throws IOException
GraphWriterTraversal to a stream with its associated edges. Only write edges as
defined by the requested direction.writeVertices in interface GraphWriteroutputStream - The stream to write to.traversal - A traversal that returns a list of vertices.direction - If direction is null then no edges are written.IOExceptionpublic void writeVertices(OutputStream outputStream, Traversal<?,Vertex> traversal) throws IOException
GraphWriterwriteVertices in interface GraphWriteroutputStream - The stream to write to.traversal - A traversal that returns a list of vertices.IOExceptionpublic static GraphSONWriter.Builder build()
Copyright © 2013–2015 Apache Software Foundation. All rights reserved.