Class GraphDotModelWriter

All Implemented Interfaces:
AutoCloseable

public final class GraphDotModelWriter extends GraphDotProductionWriter
Writer for creating content conforming to the graphviz dot language syntax specification, see DOT Language.

This writer offers methods named writeModel* to write syntax tree POJO models. As such, it offers the highest level API.

See GraphDotProductionWriter, for writing individual grammar productions.

See GraphDotTokenWriter, for writing individual tokens manually.

Since:
8.2.0
Author:
XIMA MEDIA GmbH
See Also:
  • Method Details

    • writeModelAssignment

      public void writeModelAssignment(Assignment assignment) throws IOException
      Writes an assignment model.
      Parameters:
      assignment - Assignment to write.
      Throws:
      IOException - When content could not be written to the writer.
    • writeModelAssignmentStatement

      public void writeModelAssignmentStatement(AssignmentStatement propertyStatement) throws IOException
      Writes an assignment statement model.
      Parameters:
      propertyStatement - Property statement to write.
      Throws:
      IOException - When content could not be written to the writer.
    • writeModelAttributeList

      public void writeModelAttributeList(IGraphDotAttributeList attributeList) throws IOException
      Writes an attribute list model.
      Parameters:
      attributeList - Attribute list to write.
      Throws:
      IOException - When content could not be written to the writer.
    • writeModelAttributeStatement

      public void writeModelAttributeStatement(AttributeStatement attributeStatement) throws IOException
      Writes an attribute statement model.
      Parameters:
      attributeStatement - Attribute statement to write.
      Throws:
      IOException - When content could not be written to the writer.
    • writeModelEdgeStatement

      public void writeModelEdgeStatement(IGraphDotEdgeStatement<?> edgeStatement) throws IOException
      Write an edge model
      Parameters:
      edgeStatement - Edge statement to write.
      Throws:
      IOException - When content could not be written to the writer.
    • writeModelGraph

      public void writeModelGraph(IGraphDotGraph<?> graph) throws IOException
      Writes a graph model.
      Parameters:
      graph - Graph to write.
      Throws:
      IOException - When content could not be written to the writer.
    • writeModelNodeId

      public void writeModelNodeId(NodeId nodeId) throws IOException
      Writes a node ID model.
      Parameters:
      nodeId - A node ID element to write.
      Throws:
      IOException - When content could not be written to the writer.
    • writeModelNodeStatement

      public void writeModelNodeStatement(NodeStatement nodeStatement) throws IOException
      Write a node statement model.
      Parameters:
      nodeStatement - Node statement to write.
      Throws:
      IOException - When content could not be written to the writer.
    • writeModelPort

      public void writeModelPort(Port port) throws IOException
      Writes a port model.
      Parameters:
      port - Port to write.
      Throws:
      IOException - When content could not be written to the writer.
    • writeModelSubGraph

      public void writeModelSubGraph(IGraphDotSubGraph<?,?> subGraph) throws IOException
      Writes a sub graph statement model.
      Parameters:
      subGraph - Sub graph statement to write.
      Throws:
      IOException - When content could not be written to the writer.
    • writeModelSubGraphExpression

      public void writeModelSubGraphExpression(IGraphDotSubGraphExpression<?> subGraphExpression) throws IOException
      Writes a sub graph expression model.
      Parameters:
      subGraphExpression - Sub graph expression to write.
      Throws:
      IOException - When content could not be written to the writer.
    • forWriter

      public static GraphDotModelWriter forWriter(Writer writer)
      Creates a new dot graph model writer. The content is written to the given writer.
      Parameters:
      writer - Writer to which to write the output.
      Returns:
      A new graph dot model writer.
    • forWriter

      public static GraphDotModelWriter forWriter(Writer writer, CharSequence indentChar)
      Creates a new dot graph model writer. The content is written to the given writer.
      Parameters:
      writer - Writer to which to write the output.
      indentChar - Char sequence to use for indenting.
      Returns:
      A new graph dot model writer.