public final class GraphSONReader extends Object implements GraphReader
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 there is a mapper serializer supplied.| Modifier and Type | Class and Description | 
|---|---|
| static class  | GraphSONReader.Builder | 
GraphReader.ReaderBuilder<T extends GraphReader>| Modifier and Type | Method and Description | 
|---|---|
| static GraphSONReader.Builder | build() | 
| Edge | readEdge(InputStream inputStream,
        Function<org.apache.tinkerpop.gremlin.structure.util.Attachable<Edge>,Edge> edgeAttachMethod)Read an  Edgefrom output generated byGraphSONWriter.writeEdge(OutputStream, Edge)or via
 anEdgepassed toGraphSONWriter.writeObject(OutputStream, Object). | 
| void | readGraph(InputStream inputStream,
         Graph graphToWriteTo)Read data into a  Graphfrom output generated by any of theGraphSONWriterwriteVertexorwriteVerticesmethods or byGryoWriter.writeGraph(OutputStream, Graph). | 
| <C> C | readObject(InputStream inputStream,
          Class<? extends C> clazz)Reads an arbitrary object using the registered serializers. | 
| Property | readProperty(InputStream inputStream,
            Function<org.apache.tinkerpop.gremlin.structure.util.Attachable<Property>,Property> propertyAttachMethod)Read a  Propertyfrom output generated byGraphSONWriter.writeProperty(OutputStream, Property)or
 via anPropertypassed toGraphSONWriter.writeObject(OutputStream, Object). | 
| Vertex | readVertex(InputStream inputStream,
          Function<org.apache.tinkerpop.gremlin.structure.util.Attachable<Vertex>,Vertex> vertexAttachMethod)Read a  Vertexfrom output generated by any of theGraphSONWriterwriteVertexorwriteVerticesmethods or byGraphSONWriter.writeGraph(OutputStream, Graph). | 
| Vertex | readVertex(InputStream inputStream,
          Function<org.apache.tinkerpop.gremlin.structure.util.Attachable<Vertex>,Vertex> vertexAttachMethod,
          Function<org.apache.tinkerpop.gremlin.structure.util.Attachable<Edge>,Edge> edgeAttachMethod,
          Direction attachEdgesOfThisDirection)Read a  Vertexfrom output generated by any of theGraphSONWriterwriteVertexorwriteVerticesmethods or byGraphSONWriter.writeGraph(OutputStream, Graph). | 
| VertexProperty | readVertexProperty(InputStream inputStream,
                  Function<org.apache.tinkerpop.gremlin.structure.util.Attachable<VertexProperty>,VertexProperty> vertexPropertyAttachMethod)Read a  VertexPropertyfrom output generated byGraphSONWriter.writeVertexProperty(OutputStream, VertexProperty)or via anVertexPropertypassed
 toGraphSONWriter.writeObject(OutputStream, Object). | 
| Iterator<Vertex> | readVertices(InputStream inputStream,
            Function<org.apache.tinkerpop.gremlin.structure.util.Attachable<Vertex>,Vertex> vertexAttachMethod,
            Function<org.apache.tinkerpop.gremlin.structure.util.Attachable<Edge>,Edge> edgeAttachMethod,
            Direction attachEdgesOfThisDirection)Read  Vertexobjects from output generated by any of theGraphSONWriterwriteVertexorwriteVerticesmethods or byGraphSONWriter.writeGraph(OutputStream, Graph). | 
public void readGraph(InputStream inputStream, Graph graphToWriteTo) throws IOException
Graph from output generated by any of the GraphSONWriter writeVertex or
 writeVertices methods or by GryoWriter.writeGraph(OutputStream, Graph).readGraph in interface GraphReaderinputStream - a stream containing an entire graph of vertices and edges as defined by the accompanying
                    GraphSONWriter.writeGraph(OutputStream, Graph).graphToWriteTo - the graph to write to when reading from the stream.IOExceptionpublic Iterator<Vertex> readVertices(InputStream inputStream, Function<org.apache.tinkerpop.gremlin.structure.util.Attachable<Vertex>,Vertex> vertexAttachMethod, Function<org.apache.tinkerpop.gremlin.structure.util.Attachable<Edge>,Edge> edgeAttachMethod, Direction attachEdgesOfThisDirection) throws IOException
Vertex objects from output generated by any of the GraphSONWriter writeVertex or
 writeVertices methods or by GraphSONWriter.writeGraph(OutputStream, Graph).readVertices in interface GraphReaderinputStream - a stream containing at least one Vertex as defined by the accompanying
                    GraphWriter.writeVertices(OutputStream, Iterator, Direction) or
                    GraphWriter.writeVertices(OutputStream, Iterator) methods.vertexAttachMethod - a function that creates re-attaches a Vertex to a Host object.edgeAttachMethod - a function that creates re-attaches a Edge to a Host object.attachEdgesOfThisDirection - only edges of this direction are passed to the edgeMaker.IOExceptionpublic Vertex readVertex(InputStream inputStream, Function<org.apache.tinkerpop.gremlin.structure.util.Attachable<Vertex>,Vertex> vertexAttachMethod) throws IOException
Vertex  from output generated by any of the GraphSONWriter writeVertex or
 writeVertices methods or by GraphSONWriter.writeGraph(OutputStream, Graph).readVertex in interface GraphReaderinputStream - a stream containing at least a single vertex as defined by the accompanying
                    GraphWriter.writeVertex(OutputStream, Vertex).vertexAttachMethod - a function that creates re-attaches a Vertex to a Host object.IOExceptionpublic Vertex readVertex(InputStream inputStream, Function<org.apache.tinkerpop.gremlin.structure.util.Attachable<Vertex>,Vertex> vertexAttachMethod, Function<org.apache.tinkerpop.gremlin.structure.util.Attachable<Edge>,Edge> edgeAttachMethod, Direction attachEdgesOfThisDirection) throws IOException
Vertex from output generated by any of the GraphSONWriter writeVertex or
 writeVertices methods or by GraphSONWriter.writeGraph(OutputStream, Graph).readVertex in interface GraphReaderinputStream - a stream containing at least one Vertex as defined by the accompanying
                    GraphWriter.writeVertices(OutputStream, Iterator, Direction) method.vertexAttachMethod - a function that creates re-attaches a Vertex to a Host object.edgeAttachMethod - a function that creates re-attaches a Edge to a Host object.attachEdgesOfThisDirection - only edges of this direction are passed to the edgeMaker.IOExceptionpublic Edge readEdge(InputStream inputStream, Function<org.apache.tinkerpop.gremlin.structure.util.Attachable<Edge>,Edge> edgeAttachMethod) throws IOException
Edge from output generated by GraphSONWriter.writeEdge(OutputStream, Edge) or via
 an Edge passed to GraphSONWriter.writeObject(OutputStream, Object).readEdge in interface GraphReaderinputStream - a stream containing at least one Edge as defined by the accompanying
                    GraphWriter.writeEdge(OutputStream, Edge) method.edgeAttachMethod - a function that creates re-attaches a Edge to a Host object.IOExceptionpublic VertexProperty readVertexProperty(InputStream inputStream, Function<org.apache.tinkerpop.gremlin.structure.util.Attachable<VertexProperty>,VertexProperty> vertexPropertyAttachMethod) throws IOException
VertexProperty from output generated by
 GraphSONWriter.writeVertexProperty(OutputStream, VertexProperty) or via an VertexProperty passed
 to GraphSONWriter.writeObject(OutputStream, Object).readVertexProperty in interface GraphReaderinputStream - a stream containing at least one VertexProperty as written by the accompanying
                    GraphWriter.writeVertexProperty(OutputStream, VertexProperty) method.vertexPropertyAttachMethod - a function that creates re-attaches a VertexProperty to a
                                   Host object.IOExceptionpublic Property readProperty(InputStream inputStream, Function<org.apache.tinkerpop.gremlin.structure.util.Attachable<Property>,Property> propertyAttachMethod) throws IOException
Property from output generated by  GraphSONWriter.writeProperty(OutputStream, Property) or
 via an Property passed to GraphSONWriter.writeObject(OutputStream, Object).readProperty in interface GraphReaderinputStream - a stream containing at least one Property as written by the accompanying
                    GraphWriter.writeProperty(OutputStream, Property) method.propertyAttachMethod - a function that creates re-attaches a Property to a Host object.IOExceptionpublic <C> C readObject(InputStream inputStream, Class<? extends C> clazz) throws IOException
readObject in interface GraphReaderinputStream - a stream containing an object.clazz - the class expected to be in the stream - may or may not be used by the underlying implementation.IOExceptionpublic static GraphSONReader.Builder build()
Copyright © 2013–2015 Apache Software Foundation. All rights reserved.