org.eclipse.emf.henshin.interpreter.impl
Class ScriptEngineWrapper

java.lang.Object
  extended by org.eclipse.emf.henshin.interpreter.impl.ScriptEngineWrapper

public class ScriptEngineWrapper
extends Object

Script engine wrapper for automatic handling of Java imports.


Constructor Summary
ScriptEngineWrapper(ScriptEngine engine)
           
 
Method Summary
 Object eval(String script, List<String> imports)
          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.
 ScriptEngine getEngine()
           
static ScriptEngineWrapper newInstance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptEngineWrapper

public ScriptEngineWrapper(ScriptEngine engine)
Method Detail

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()