Class Script
- java.lang.Object
-
- edu.uiuc.ncsa.security.util.functor.parser.FunctorScript
-
- edu.uiuc.ncsa.security.util.functor.parser.Script
-
- All Implemented Interfaces:
ScriptInterface
,Serializable
public class Script extends FunctorScript
A wrapper for a couple of type of scripting objects. This is to determine which is which and execute the script. Either this has a JSONObject (like aLogicBlock
or it has a JSONArray of strings that are to be executed sequentially.
Note that the factory and parser contain the environment of the execution. If an older set of logic blocks, these are available in theFunctorScript.getLogicBlocks()
call. If this is from a newer script, the complete set of returned handlers from the parser is available in theFunctorScript.getHandlers()
call.
The two formats for the JSON object are either{"script":[ "line 1", "line 2", ... ], "version":"1.0"}
where each line is a separate command (version is optional) or as described in the comment toJFunctorFactory.createLogicBlock(JSONObject)
Note this this has several convenience methods, such asFunctorScript.getFunctorMap()
.
Also, you may either create this and execute is against arguments OR initialize it with JSON and execute it later when needed in your control flow. This allows you to configure everything the way you need it up front.Created by Jeff Gaynor
on 9/24/18 at 1:49 PM- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class edu.uiuc.ncsa.security.util.functor.parser.FunctorScript
SCRIPT_KEY
-
-
Constructor Summary
Constructors Constructor Description Script(JFunctorFactory functorFactory)
-
Method Summary
-
Methods inherited from class edu.uiuc.ncsa.security.util.functor.parser.FunctorScript
checkVersion, createParser, execute, execute, execute, execute, execute, execute, executeJSON, executeScript, executeScript, getFunctorMap, getHandlers, getLogicBlocks, getProperties, hasHandlers, hasLogicBlocks, toString
-
-
-
-
Constructor Detail
-
Script
public Script(JFunctorFactory functorFactory)
-
-