org.apache.tinkerpop.gremlin.structure.io.graphml

## Class GraphMLWriter

- java.lang.Object
- - org.apache.tinkerpop.gremlin.structure.io.graphml.GraphMLWriter

- All Implemented Interfaces:
    GraphWriter

      public final class GraphMLWriter
      extends Object
      implements GraphWriter

  GraphMLWriter writes a Graph to a GraphML OutputStream. Note that this format is lossy, in the sense that data types and features of Gremlin Structure not supported by GraphML are not serialized. This format is meant for external export of a graph to tools outside of Gremlin Structure graphs. Note that GraphML does not support the notion of multi-properties or properties on properties and will throw an exception when writing a graph elements that have such things.
  Author:
    Marko A. Rodriguez (http://markorodriguez.com), Joshua Shinavier (http://fortytwo.net), Stephen Mallette (http://stephen.genoprime.com)

- - ### Nested Class Summary

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

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

      `GraphWriter.WriterBuilder<T extends GraphWriter>`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static GraphMLWriter.Builder` | `build()`
    `void` | `writeEdge(OutputStream outputStream, Edge e)` This method is not supported for this writer.
    `void` | `writeGraph(OutputStream outputStream, Graph g)` Write the data in a Graph to a GraphML OutputStream.
    `void` | `writeObject(OutputStream outputStream, Object object)` This method is not supported for this writer.
    `void` | `writeProperty(OutputStream outputStream, Property p)` This method is not supported for this writer.
    `void` | `writeVertex(OutputStream outputStream, Vertex v)` This method is not supported for this writer.
    `void` | `writeVertex(OutputStream outputStream, Vertex v, Direction direction)` This method is not supported for this writer.
    `void` | `writeVertexProperty(OutputStream outputStream, VertexProperty vp)` This method is not supported for this writer.
    `void` | `writeVertices(OutputStream outputStream, Iterator<Vertex> vertexIterator)` This method is not supported for this writer.
    `void` | `writeVertices(OutputStream outputStream, Iterator<Vertex> vertexIterator, Direction direction)` This method is not supported for this writer.

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

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

- - ### Method Detail

    - #### writeVertex

          public void writeVertex(OutputStream outputStream,
                                  Vertex v,
                                  Direction direction)
                           throws IOException

      This method is not supported for this writer.
      Specified by:
        `writeVertex` in interface `GraphWriter`
      Parameters:
        `outputStream` - the stream to write to.
        `v` - the vertex to write.
        `direction` - the direction of edges to write or null if no edges are to be written.
      Throws:
        `UnsupportedOperationException` - when called.
        `IOException`

    - #### writeVertex

          public void writeVertex(OutputStream outputStream,
                                  Vertex v)
                           throws IOException

      This method is not supported for this writer.
      Specified by:
        `writeVertex` in interface `GraphWriter`
      Parameters:
        `outputStream` - the stream to write to.
        `v` - the vertex to write.
      Throws:
        `UnsupportedOperationException` - when called.
        `IOException`

    - #### writeEdge

          public void writeEdge(OutputStream outputStream,
                                Edge e)
                         throws IOException

      This method is not supported for this writer.
      Specified by:
        `writeEdge` in interface `GraphWriter`
      Parameters:
        `outputStream` - the stream to write to.
        `e` - the edge to write.
      Throws:
        `UnsupportedOperationException` - when called.
        `IOException`

    - #### writeVertices

          public void writeVertices(OutputStream outputStream,
                                    Iterator<Vertex> vertexIterator,
                                    Direction direction)
                             throws IOException

      This method is not supported for this writer.
      Specified by:
        `writeVertices` in interface `GraphWriter`
      Parameters:
        `outputStream` - the stream to write to.
        `vertexIterator` - a traversal that returns a list of vertices.
        `direction` - the direction of edges to write or null if no edges are to be written.
      Throws:
        `UnsupportedOperationException` - when called.
        `IOException`

    - #### writeVertices

          public void writeVertices(OutputStream outputStream,
                                    Iterator<Vertex> vertexIterator)
                             throws IOException

      This method is not supported for this writer.
      Specified by:
        `writeVertices` in interface `GraphWriter`
      Parameters:
        `outputStream` - the stream to write to.
        `vertexIterator` - a iterator that returns a list of vertices.
      Throws:
        `UnsupportedOperationException` - when called.
        `IOException`

    - #### writeVertexProperty

          public void writeVertexProperty(OutputStream outputStream,
                                          VertexProperty vp)
                                   throws IOException

      This method is not supported for this writer.
      Specified by:
        `writeVertexProperty` in interface `GraphWriter`
      Parameters:
        `outputStream` - the stream to write to.
        `vp` - the vertex property to write.
      Throws:
        `UnsupportedOperationException` - when called.
        `IOException`

    - #### writeProperty

          public void writeProperty(OutputStream outputStream,
                                    Property p)
                             throws IOException

      This method is not supported for this writer.
      Specified by:
        `writeProperty` in interface `GraphWriter`
      Parameters:
        `outputStream` - the stream to write to.
        `p` - the property to write.
      Throws:
        `UnsupportedOperationException` - when called.
        `IOException`

    - #### writeObject

          public void writeObject(OutputStream outputStream,
                                  Object object)
                           throws IOException

      This method is not supported for this writer.
      Specified by:
        `writeObject` in interface `GraphWriter`
      Parameters:
        `outputStream` - the stream to write to.
        `object` - the object to write which will use the standard serializer set.
      Throws:
        `UnsupportedOperationException` - when called.
        `IOException`

    - #### writeGraph

          public void writeGraph(OutputStream outputStream,
                                 Graph g)
                          throws IOException

      Write the data in a Graph to a GraphML OutputStream.
      Specified by:
        `writeGraph` in interface `GraphWriter`
      Parameters:
        `outputStream` - the GraphML OutputStream to write the Graph data to
        `g` - the graph to write to stream.
      Throws:
        `IOException` - thrown if there is an error generating the GraphML data

    - #### build

          public static GraphMLWriter.Builder build()

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