From 684e01bb190c7d0b95347b732aeb3cdeda4740d7 Mon Sep 17 00:00:00 2001 From: abranson Date: Tue, 18 Oct 2011 17:00:33 +0200 Subject: Module support --- source/com/c2kernel/scripting/Script.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'source/com/c2kernel/scripting/Script.java') diff --git a/source/com/c2kernel/scripting/Script.java b/source/com/c2kernel/scripting/Script.java index 0820c26..c056e95 100644 --- a/source/com/c2kernel/scripting/Script.java +++ b/source/com/c2kernel/scripting/Script.java @@ -72,19 +72,24 @@ public class Script * Creates a script executor for the supplied expression, bypassing the xml parsing bit * Output class is forced to an object. */ - public Script(String lang, String expr, BSFManager scriptManager) throws ScriptingEngineException + public Script(String lang, String expr, BSFManager scriptManager, Class returnType) throws ScriptingEngineException { setScriptEnv(scriptManager); mName = ""; mLang = lang; mVersion = ""; - mOutputClass = Object.class; + mOutputClass = returnType; mScript = expr; } public Script(String lang, String expr) throws ScriptingEngineException { - this(lang, expr, new BSFManager()); + this(lang, expr, new BSFManager(), Object.class); + } + + public Script(String lang, String expr, Class returnType) throws ScriptingEngineException + { + this(lang, expr, new BSFManager(), returnType); } public Script(ItemProxy object, AgentProxy subject, Job job) throws ScriptingEngineException -- cgit v1.2.3