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
GraphWriter
writeGraph
in interface GraphWriter
IOException
public void writeVertex(OutputStream outputStream, Vertex v, Direction direction) throws IOException
GraphWriter
writeVertex
in interface GraphWriter
outputStream
- The stream to write to.v
- The vertex to write.direction
- If direction is null then no edges are written.IOException
public void writeVertex(OutputStream outputStream, Vertex v) throws IOException
GraphWriter
writeVertex
in interface GraphWriter
outputStream
- The stream to write to.v
- The vertex to write.IOException
public void writeEdge(OutputStream outputStream, Edge e) throws IOException
GraphWriter
writeEdge
in interface GraphWriter
IOException
public void writeVertices(OutputStream outputStream, Traversal<?,Vertex> traversal, Direction direction) throws IOException
GraphWriter
Traversal
to a stream with its associated edges. Only write edges as
defined by the requested direction.writeVertices
in interface GraphWriter
outputStream
- The stream to write to.traversal
- A traversal that returns a list of vertices.direction
- If direction is null then no edges are written.IOException
public void writeVertices(OutputStream outputStream, Traversal<?,Vertex> traversal) throws IOException
GraphWriter
writeVertices
in interface GraphWriter
outputStream
- The stream to write to.traversal
- A traversal that returns a list of vertices.IOException
public static GraphSONWriter.Builder build()
Copyright © 2013–2015 Apache Software Foundation. All rights reserved.