org.eclipse.emf.henshin.interpreter.impl
Class ScriptEngineWrapper
java.lang.Object
org.eclipse.emf.henshin.interpreter.impl.ScriptEngineWrapper
public class ScriptEngineWrapper
- extends Object
Script engine wrapper for automatic handling of Java imports.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ScriptEngineWrapper
public ScriptEngineWrapper(ScriptEngine engine)
getEngine
public ScriptEngine getEngine()
eval
public Object eval(String script,
List<String> imports)
throws ScriptException
- Evaluates a given expression in a context which is extended with the
provided imports
The imports are on purpose not added to the global scope to prevent
pollution of the namespace.
- Parameters:
script
- Script to be executed.imports
- List of imports.
- Returns:
- The result.
- Throws:
ScriptException
- On script execution errors.
newInstance
public static ScriptEngineWrapper newInstance()