Class DOTEventDrivenImporter

All Implemented Interfaces:
EventDrivenImporter<String,Pair<String,String>>

public class DOTEventDrivenImporter extends BaseEventDrivenImporter<String,Pair<String,String>> implements EventDrivenImporter<String,Pair<String,String>>
Import a graph from a DOT file.

For a description of the format see http://en.wikipedia.org/wiki/DOT_language and http://www.graphviz.org/doc/info/lang.html

The importer notifies interested parties using consumers.

  • Field Details

    • DEFAULT_GRAPH_ID_KEY

      public static final String DEFAULT_GRAPH_ID_KEY
      Default key used for the graph ID.
      See Also:
    • unescapeId

      private final org.apache.commons.text.translate.CharSequenceTranslator unescapeId
    • notifyVertexAttributesOutOfOrder

      private boolean notifyVertexAttributesOutOfOrder
    • notifyEdgeAttributesOutOfOrder

      private boolean notifyEdgeAttributesOutOfOrder
  • Constructor Details

    • DOTEventDrivenImporter

      public DOTEventDrivenImporter()
      Constructs a new importer.
    • DOTEventDrivenImporter

      public DOTEventDrivenImporter(boolean notifyVertexAttributesOutOfOrder, boolean notifyEdgeAttributesOutOfOrder)
      Constructs a new importer.
      Parameters:
      notifyVertexAttributesOutOfOrder - whether to notify for vertex attributes out-of-order even if they appear together in the input
      notifyEdgeAttributesOutOfOrder - whether to notify for edge attributes out-of-order even if they appear together in the input
  • Method Details

    • importInput

      public void importInput(Reader in) throws ImportException
      Description copied from interface: EventDrivenImporter
      Import a graph
      Specified by:
      importInput in interface EventDrivenImporter<String,Pair<String,String>>
      Parameters:
      in - the input reader
      Throws:
      ImportException - in case any error occurs, such as I/O or parse error
    • unescapeId

      private String unescapeId(String input)
      Unescape a string DOT identifier.
      Parameters:
      input - the input
      Returns:
      the unescaped output
    • unescapeHtmlString

      private static String unescapeHtmlString(String input)
      Unescape an HTML string DOT identifier.
      Parameters:
      input - the input
      Returns:
      the unescaped output