public class ScriptExecutor extends Object
Constructor and Description |
---|
ScriptExecutor(ScriptEngineManager engineManager,
String engineName,
String command,
ClassLoader classLoader) |
ScriptExecutor(ScriptEngineManager engineManager,
String engineName,
URL commandUrl,
ClassLoader classLoader) |
ScriptExecutor(ScriptEngine engine,
String command,
ClassLoader classLoader)
Construct a new script executors
|
ScriptExecutor(ScriptEngine engine,
String command,
ClassLoader classLoader,
String sourceName)
Construct a new script executors
|
ScriptExecutor(ScriptEngine engine,
URL commandUrl,
ClassLoader classLoader) |
Modifier and Type | Method and Description |
---|---|
protected Map<String,Object> |
applyVars(ScriptContext context,
Map<String,Object> scriptObjects) |
Object |
execute(ScriptContext scriptContext) |
Object |
execute(ScriptContext scriptContext,
Map<String,Object> scriptObjects) |
protected void |
restoreVars(ScriptContext context,
Map<String,Object> vars) |
String |
toString() |
public ScriptExecutor(ScriptEngineManager engineManager, String engineName, String command, ClassLoader classLoader) throws ScriptException
ScriptException
public ScriptExecutor(ScriptEngineManager engineManager, String engineName, URL commandUrl, ClassLoader classLoader) throws ScriptException, IOException
ScriptException
IOException
public ScriptExecutor(ScriptEngine engine, String command, ClassLoader classLoader, String sourceName) throws ScriptException
engine
- the script engine to use, must not be null
command
- the command to execute, may be null
classLoader
- the class loader to use when executing, may be
null
ScriptException
public ScriptExecutor(ScriptEngine engine, String command, ClassLoader classLoader) throws ScriptException
engine
- the script engine to use, must not be null
command
- the command to execute, may be null
classLoader
- the class loader to use when executing, may be
null
ScriptException
public ScriptExecutor(ScriptEngine engine, URL commandUrl, ClassLoader classLoader) throws ScriptException, IOException
ScriptException
IOException
protected Map<String,Object> applyVars(ScriptContext context, Map<String,Object> scriptObjects)
protected void restoreVars(ScriptContext context, Map<String,Object> vars)
public Object execute(ScriptContext scriptContext) throws ScriptException, IOException
ScriptException
IOException
public Object execute(ScriptContext scriptContext, Map<String,Object> scriptObjects) throws ScriptException, IOException
ScriptException
IOException