org.apache.tinkerpop.gremlin.structure.io

## Interface Io<R extends GraphReader.ReaderBuilder,W extends GraphWriter.WriterBuilder,M extends Mapper.Builder>

- All Known Implementing Classes:
    GraphBinaryIo, GraphMLIo, GraphSONIo, GryoIo

      public interface Io<R extends GraphReader.ReaderBuilder,W extends GraphWriter.WriterBuilder,M extends Mapper.Builder>

  Ties together the core interfaces of an IO format: `GraphReader`, `GraphWriter` and `Mapper`. The `Io.Builder` of an `Io` instance is supplied to `Graph.io(Io.Builder)` and the `Graph` implementation can then chose to supply an `IoRegistry` to it before returning it. An `Io` implementation should use that `IoRegistry` to lookup custom serializers to use and register them to the internal `Mapper` (if the format has such capability).
  Author:
    Stephen Mallette (http://stephen.genoprime.com)

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `Io.Builder<I extends Io>` Helps to construct an `Io` implementation and should be implemented by every such implementation as that class will be passed to `Graph.io(Io.Builder)` by the user.
    `static class` | `Io.Exceptions`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `M` | `mapper()` Constructs a `Mapper.Builder` which is responsible for constructing the abstraction over different serialization methods.
    `R` | `reader()` Creates a `GraphReader.ReaderBuilder` implementation .
    `void` | `readGraph(String file)` Read a `Graph` from file using the default configuration of the `reader()` and its supplied `mapper()`.
    `void` | `writeGraph(String file)` Write a `Graph` to file using the default configuration of the `writer()` and its supplied `mapper()`.
    `W` | `writer()` Creates a `GraphWriter.WriterBuilder` implementation .

- - ### Method Detail

    - #### reader

          R reader()

      Creates a `GraphReader.ReaderBuilder` implementation . Implementers should call the `mapper()` function to feed its result to the builder. In this way, custom class serializers registered to the `Mapper.Builder` by `Graph` implementations will end up being used for the serialization process.

    - #### writer

          W writer()

      Creates a `GraphWriter.WriterBuilder` implementation . Implementers should call the `mapper()` function to feed its result to the builder. In this way, custom class serializers registered to the `Mapper.Builder` by `Graph` implementations will end up being used for the serialization process.

    - #### mapper

          M mapper()

      Constructs a `Mapper.Builder` which 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 to `Mapper.Builder.addRegistry(IoRegistry)` which will provide the builder with any required custom serializers of the `Graph`.

    - #### writeGraph

          void writeGraph(String file)
                   throws IOException

      Write a `Graph` to file using the default configuration of the `writer()` and its supplied `mapper()`.
      Throws:
        `IOException`

    - #### readGraph

          void readGraph(String file)
                  throws IOException

      Read a `Graph` from file using the default configuration of the `reader()` and its supplied `mapper()`.
      Throws:
        `IOException`

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