public class JSONFlowUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS |
static java.lang.String |
CONNECTIONS |
static java.lang.String |
COORDINATES |
static java.lang.String |
ENUM_HELPER |
static java.lang.String |
FLOW_NAME |
static java.lang.String |
LOADER |
static java.lang.String |
OPTIONHANDLER |
static java.lang.String |
OPTIONS |
static java.lang.String |
PROPERTIES |
static java.lang.String |
SAVER |
static java.lang.String |
STEPS |
Constructor and Description |
---|
JSONFlowUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
flowToJSON(Flow flow)
Utility routine to serialize a supplied flow to a JSON string
|
static Flow |
JSONToFlow(java.lang.String flowJSON,
boolean dontComplainAboutMissingConnections)
Utility routine to deserialize a flow from the supplied JSON string
|
static void |
main(java.lang.String[] args)
Main method for testing this class
|
static Flow |
readFlow(java.io.File file)
Read a flow from the supplied file
|
static Flow |
readFlow(java.io.File file,
boolean dontComplainAboutMissingConnections)
Read a flow from the supplied file
|
static Flow |
readFlow(java.io.InputStream is)
Read a Flow from the supplied input stream
|
static Flow |
readFlow(java.io.InputStream is,
boolean dontComplainAboutMissingConnections)
Read a Flow from the supplied input stream
|
static Flow |
readFlow(java.io.Reader sr)
Read a flow from the supplied reader
|
static Flow |
readFlow(java.io.Reader sr,
boolean dontComplainAboutMissingConnections)
Read a flow from the supplied reader
|
static void |
writeFlow(Flow flow,
java.io.File file)
Serializes the supplied flow to JSON and writes it out to the supplied file
|
static void |
writeFlow(Flow flow,
java.io.OutputStream os)
Serializes the supplied flow to JSON and writes out using the supplied
output stream
|
static void |
writeFlow(Flow flow,
java.io.Writer writer)
Serializes the supplied flow to JSON and writes out using the supplied
writer
|
public static final java.lang.String FLOW_NAME
public static final java.lang.String STEPS
public static final java.lang.String OPTIONHANDLER
public static final java.lang.String OPTIONS
public static final java.lang.String LOADER
public static final java.lang.String SAVER
public static final java.lang.String ENUM_HELPER
public static final java.lang.String CLASS
public static final java.lang.String PROPERTIES
public static final java.lang.String CONNECTIONS
public static final java.lang.String COORDINATES
public static void writeFlow(Flow flow, java.io.Writer writer) throws WekaException
flow
- the Flow
to serializewriter
- the Writer
to write toWekaException
- if a problem occurspublic static void writeFlow(Flow flow, java.io.OutputStream os) throws WekaException
flow
- the Flow
to serializeos
- the OutputStream
to write toWekaException
- if a problem occurspublic static void writeFlow(Flow flow, java.io.File file) throws WekaException
flow
- the Flow
to serializefile
- the File
to write toWekaException
- if a problem occurspublic static Flow readFlow(java.io.File file) throws WekaException
file
- the file to read fromFlow
WekaException
- if a problem occurspublic static Flow readFlow(java.io.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(java.io.InputStream is) throws WekaException
is
- the InputStream
to read fromWekaException
- if a problem occurspublic static Flow readFlow(java.io.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(java.io.Reader sr) throws WekaException
sr
- the reader to read fromWekaException
- if a problem occurspublic static Flow readFlow(java.io.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(java.lang.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 java.lang.String flowToJSON(Flow flow) throws WekaException
flow
- the flow to serializeWekaException
- if a problem occurspublic static void main(java.lang.String[] args)
args
- command line arguments