org.apache.tinkerpop.gremlin.structure.io.graphson

## Class LegacyGraphSONReader

- java.lang.Object
- - org.apache.tinkerpop.gremlin.structure.io.graphson.LegacyGraphSONReader

- All Implemented Interfaces:
    GraphReader

      public final class LegacyGraphSONReader
      extends Object
      implements GraphReader

  A @{link GraphReader} that constructs a graph from a JSON-based representation of a graph and its elements given the "legacy" Blueprints 2.x version of GraphSON. This implementation is specifically for aiding in migration of graphs from TinkerPop 2.x to TinkerPop 3.x. This reader only reads GraphSON from TinkerPop 2.x that was generated in `GraphSONMode.EXTENDED`.
  Author:
    Stephen Mallette (http://stephen.genoprime.com)

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `LegacyGraphSONReader.Builder`
    `static class` | `LegacyGraphSONReader.GraphSONTokensTP2`

    - ### Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.structure.io.GraphReader

      `GraphReader.ReaderBuilder<T extends GraphReader>`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static LegacyGraphSONReader.Builder` | `build()`
    `Edge` | `readEdge(InputStream inputStream, Function<Attachable<Edge>,Edge> edgeAttachMethod)` This method is not supported for this reader.
    `void` | `readGraph(InputStream inputStream, Graph graphToWriteTo)` Reads an entire graph from an `InputStream`.
    `<C> C` | `readObject(InputStream inputStream, Class<? extends C> clazz)` This method is not supported for this reader.
    `Property` | `readProperty(InputStream inputStream, Function<Attachable<Property>,Property> propertyAttachMethod)` This method is not supported for this reader.
    `Vertex` | `readVertex(InputStream inputStream, Function<Attachable<Vertex>,Vertex> vertexAttachMethod)` This method is not supported for this reader.
    `Vertex` | `readVertex(InputStream inputStream, Function<Attachable<Vertex>,Vertex> vertexAttachMethod, Function<Attachable<Edge>,Edge> edgeAttachMethod, Direction attachEdgesOfThisDirection)` This method is not supported for this reader.
    `VertexProperty` | `readVertexProperty(InputStream inputStream, Function<Attachable<VertexProperty>,VertexProperty> vertexPropertyAttachMethod)` This method is not supported for this reader.
    `Iterator<Vertex>` | `readVertices(InputStream inputStream, Function<Attachable<Vertex>,Vertex> vertexAttachMethod, Function<Attachable<Edge>,Edge> edgeAttachMethod, Direction attachEdgesOfThisDirection)` This method is not supported for this reader.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.tinkerpop.gremlin.structure.io.GraphReader

      `readVertex`

- - ### Method Detail

    - #### readGraph

          public void readGraph(InputStream inputStream,
                                Graph graphToWriteTo)
                         throws IOException

      Description copied from interface: `GraphReader`
      Reads an entire graph from an `InputStream`. This method is mean to load an empty `Graph`. It is up to individual implementations to manage transactions, but it is not required or enforced. Consult the documentation of an implementation to understand the approach it takes.
      Specified by:
        `readGraph` in interface `GraphReader`
      Parameters:
        `inputStream` - a stream containing an entire graph of vertices and edges as defined by the accompanying `GraphWriter.writeGraph(OutputStream, Graph)`.
        `graphToWriteTo` - the graph to write to when reading from the stream.
      Throws:
        `IOException`

    - #### readVertices

          public Iterator<Vertex> readVertices(InputStream inputStream,
                                               Function<Attachable<Vertex>,Vertex> vertexAttachMethod,
                                               Function<Attachable<Edge>,Edge> edgeAttachMethod,
                                               Direction attachEdgesOfThisDirection)
                                        throws IOException

      This method is not supported for this reader.
      Specified by:
        `readVertices` in interface `GraphReader`
      Parameters:
        `inputStream` - 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`.
      Throws:
        `UnsupportedOperationException` - when called.
        `IOException`

    - #### readEdge

          public Edge readEdge(InputStream inputStream,
                               Function<Attachable<Edge>,Edge> edgeAttachMethod)
                        throws IOException

      This method is not supported for this reader.
      Specified by:
        `readEdge` in interface `GraphReader`
      Parameters:
        `inputStream` - 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.
      Throws:
        `UnsupportedOperationException` - when called.
        `IOException`

    - #### readVertex

          public Vertex readVertex(InputStream inputStream,
                                   Function<Attachable<Vertex>,Vertex> vertexAttachMethod)
                            throws IOException

      This method is not supported for this reader.
      Specified by:
        `readVertex` in interface `GraphReader`
      Parameters:
        `inputStream` - 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.
      Throws:
        `UnsupportedOperationException` - when called.
        `IOException`

    - #### readVertex

          public Vertex readVertex(InputStream inputStream,
                                   Function<Attachable<Vertex>,Vertex> vertexAttachMethod,
                                   Function<Attachable<Edge>,Edge> edgeAttachMethod,
                                   Direction attachEdgesOfThisDirection)
                            throws IOException

      This method is not supported for this reader.
      Specified by:
        `readVertex` in interface `GraphReader`
      Parameters:
        `inputStream` - 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`.
      Throws:
        `UnsupportedOperationException` - when called.
        `IOException`

    - #### readVertexProperty

          public VertexProperty readVertexProperty(InputStream inputStream,
                                                   Function<Attachable<VertexProperty>,VertexProperty> vertexPropertyAttachMethod)
                                            throws IOException

      This method is not supported for this reader.
      Specified by:
        `readVertexProperty` in interface `GraphReader`
      Parameters:
        `inputStream` - 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.
      Returns:
        the value returned by the attach method.
      Throws:
        `UnsupportedOperationException` - when called.
        `IOException`

    - #### readProperty

          public Property readProperty(InputStream inputStream,
                                       Function<Attachable<Property>,Property> propertyAttachMethod)
                                throws IOException

      This method is not supported for this reader.
      Specified by:
        `readProperty` in interface `GraphReader`
      Parameters:
        `inputStream` - 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.
      Returns:
        the value returned by the attach method.
      Throws:
        `UnsupportedOperationException` - when called.
        `IOException`

    - #### readObject

          public <C> C readObject(InputStream inputStream,
                                  Class<? extends C> clazz)
                           throws IOException

      This method is not supported for this reader.
      Specified by:
        `readObject` in interface `GraphReader`
      Parameters:
        `inputStream` - a stream containing an object.
        `clazz` - the class expected to be in the stream - may or may not be used by the underlying implementation.
      Throws:
        `UnsupportedOperationException` - when called.
        `IOException`

    - #### build

          public static LegacyGraphSONReader.Builder build()

Copyright © 2013–2018 Apache Software Foundation. All rights reserved.