Class GraphIO

java.lang.Object
org.esa.snap.core.gpf.graph.GraphIO

public class GraphIO extends Object
The GraphIO class contains methods for the serialization/deserialization of XML-based Graph definitions.
  • Method Details

    • write

      public static void write(Graph graph, Writer writer)
      Serializes the given graph into XML
      Parameters:
      graph - the graph to write into XML
      writer - the writer to use for serialization.
    • read

      public static Graph read(Reader reader) throws GraphException
      Deserializes a graph from an XML Reader.
      Parameters:
      reader - the readerto use for deserialization
      Returns:
      the deserialized graph
      Throws:
      GraphException - if an error occurs during reading
    • read

      public static Graph read(Reader reader, Map<String,String> variables) throws GraphException
      Deserializes a Graph from a XML Reader using a mapping for the substitution of template variables inside the XML-based Graph definition.
      Parameters:
      reader - the XML reader
      variables - a mapping from template variable names to their string values.
      Returns:
      the deserialized graph
      Throws:
      GraphException - if an error occurs during reading