public class Script extends AbstractScript
LogicBlock
or it has a JSONArray
of strings that are to be executed sequentially. getLogicBlocks()
call. If this is from a newer script, the complete set
of returned handlers from the parser is available in the AbstractScript.getHandlers()
call.
{"script":[ "line 1", "line 2", ... ], "version":"1.0"}where each line is a separate command (version is optional) or as described in the comment to
JFunctorFactory.createLogicBlock(JSONObject)
AbstractScript.getFunctorMap()
.Created by Jeff Gaynor
on 9/24/18 at 1:49 PM
Modifier and Type | Field and Description |
---|---|
static String |
SCRIPT_KEY |
static String |
VERSION_1_0 |
static String |
VERSION_KEY |
Constructor and Description |
---|
Script(JFunctorFactory functorFactory) |
Script(JFunctorFactory functorFactory,
net.sf.json.JSONObject rawContent)
Use this to initialize the entire parser in advance of execution.
|
Modifier and Type | Method and Description |
---|---|
void |
execute() |
void |
execute(net.sf.json.JSONObject rawContent)
Figure out what type of object is to be executed.
|
protected void |
executeJSON(net.sf.json.JSONObject rawContent)
Execute the old JSON functor and put it into a script object.
|
protected void |
executeScript(net.sf.json.JSONObject rawContent) |
LogicBlocks<? extends LogicBlock> |
getLogicBlocks() |
boolean |
hasLogicBlocks() |
checkVersion, createParser, execute, execute, execute, executeScript, getFunctorMap, getHandlers, hasHandlers
public static String SCRIPT_KEY
public static String VERSION_KEY
public static final String VERSION_1_0
public Script(JFunctorFactory functorFactory, net.sf.json.JSONObject rawContent)
execute()
method when you need to.functorFactory
- rawContent
- public Script(JFunctorFactory functorFactory)
public void execute()
public void execute(net.sf.json.JSONObject rawContent)
Throwable
protected void executeScript(net.sf.json.JSONObject rawContent)
public boolean hasLogicBlocks()
protected void executeJSON(net.sf.json.JSONObject rawContent)
{"script":[array of lines as they are in a command file]}So be sure you are sending that if this method executes for no apparent reason. If the argument is not in the above form, it falls through to this case since it can be hard to figure out and the factory is good at that.
rawContent
- public LogicBlocks<? extends LogicBlock> getLogicBlocks()
Copyright © 2019. All Rights Reserved.