public class JSONFlowUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
CLASS |
static String |
CONNECTIONS |
static String |
COORDINATES |
static String |
ENUM_HELPER |
static String |
FLOW_NAME |
static String |
LOADER |
static String |
OPTIONHANDLER |
static String |
OPTIONS |
static String |
PROPERTIES |
static String |
SAVER |
static String |
STEPS |
| Constructor and Description |
|---|
JSONFlowUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
flowToJSON(Flow flow)
Utility routine to serialize a supplied flow to a JSON string
|
static Flow |
JSONToFlow(String flowJSON,
boolean dontComplainAboutMissingConnections)
Utility routine to deserialize a flow from the supplied JSON string
|
static void |
main(String[] args)
Main method for testing this class
|
static Flow |
readFlow(File file)
Read a flow from the supplied file
|
static Flow |
readFlow(File file,
boolean dontComplainAboutMissingConnections)
Read a flow from the supplied file
|
static Flow |
readFlow(InputStream is)
Read a Flow from the supplied input stream
|
static Flow |
readFlow(InputStream is,
boolean dontComplainAboutMissingConnections)
Read a Flow from the supplied input stream
|
static Flow |
readFlow(Reader sr)
Read a flow from the supplied reader
|
static Flow |
readFlow(Reader sr,
boolean dontComplainAboutMissingConnections)
Read a flow from the supplied reader
|
static void |
writeFlow(Flow flow,
File file)
Serializes the supplied flow to JSON and writes it out to the supplied file
|
static void |
writeFlow(Flow flow,
OutputStream os)
Serializes the supplied flow to JSON and writes out using the supplied
output stream
|
static void |
writeFlow(Flow flow,
Writer writer)
Serializes the supplied flow to JSON and writes out using the supplied
writer
|
public static final String FLOW_NAME
public static final String STEPS
public static final String OPTIONHANDLER
public static final String OPTIONS
public static final String LOADER
public static final String SAVER
public static final String ENUM_HELPER
public static final String CLASS
public static final String PROPERTIES
public static final String CONNECTIONS
public static final String COORDINATES
public static void writeFlow(Flow flow, Writer writer) throws WekaException
flow - the Flow to serializewriter - the Writer to write toWekaException - if a problem occurspublic static void writeFlow(Flow flow, OutputStream os) throws WekaException
flow - the Flow to serializeos - the OutputStream to write toWekaException - if a problem occurspublic static void writeFlow(Flow flow, File file) throws WekaException
flow - the Flow to serializefile - the File to write toWekaException - if a problem occurspublic static Flow readFlow(File file) throws WekaException
file - the file to read fromFlowWekaException - if a problem occurspublic static Flow readFlow(File file, boolean dontComplainAboutMissingConnections) throws WekaException
file - the file to read fromdontComplainAboutMissingConnections - true if no exceptions should be
raised if connections are missing in the flowWekaException - if a problem occurspublic static Flow readFlow(InputStream is) throws WekaException
is - the InputStream to read fromWekaException - if a problem occurspublic static Flow readFlow(InputStream is, boolean dontComplainAboutMissingConnections) throws WekaException
is - the InputStream to read fromdontComplainAboutMissingConnections - true if no exception should be
raised if there are missing connectionsWekaException - if a problem occurspublic static Flow readFlow(Reader sr) throws WekaException
sr - the reader to read fromWekaException - if a problem occurspublic static Flow readFlow(Reader sr, boolean dontComplainAboutMissingConnections) throws WekaException
sr - the reader to read fromdontComplainAboutMissingConnections - true if no exception should be
raised if there are missing connectionsWekaException - if a problem occurspublic static Flow JSONToFlow(String flowJSON, boolean dontComplainAboutMissingConnections) throws WekaException
flowJSON - the string containing a flow in JSON formdontComplainAboutMissingConnections - to not raise any exceptions if
there are missing connections in the flowWekaException - if a problem occurspublic static String flowToJSON(Flow flow) throws WekaException
flow - the flow to serializeWekaException - if a problem occurspublic static void main(String[] args)
args - command line argumentsCopyright © 2016 University of Waikato, Hamilton, NZ. All Rights Reserved.