Interface GraphFormat

  • All Known Implementing Classes:
    DrawflowGraphFormat

    public interface GraphFormat
    Represents a graph format, e.g., a specific JSON structure that can be applied on UI level.
    Author:
    Holger Eichelberger, SSE
    • Method Detail

      • getName

        java.lang.String getName()
        Returns the name to address/access this format.
        Returns:
        the unique name
      • getFormatKind

        java.lang.String getFormatKind()
        Returns the kind of format produced.
        Returns:
        the format kind, e.g., XML, JSON, ...
      • toString

        java.lang.String toString​(IvmlGraphMapper.IvmlGraph graph)
                           throws java.util.concurrent.ExecutionException
        Turns graph into this format.
        Parameters:
        graph - the graph, may be null
        Returns:
        the formatted graph, an empty graph if graph is null
        Throws:
        java.util.concurrent.ExecutionException - if the translation fails
      • fromString

        IvmlGraphMapper.IvmlGraph fromString​(java.lang.String graph,
                                             GraphFactory factory,
                                             DecisionVariableProvider varProvider)
                                      throws java.util.concurrent.ExecutionException
        Parses graph from this format into an IVML graph structure.
        Parameters:
        graph - the graph, may be null
        factory - a factory to be used to create graph instances
        varProvider - the provider allowing to access variables
        Returns:
        the IVML graph structure, an empty graph if graph is null
        Throws:
        java.util.concurrent.ExecutionException - if the translation fails