public class GroovyScriptEvaluator extends Object implements ScriptEvaluator, org.springframework.beans.factory.BeanClassLoaderAware
ScriptEvaluator strategy interface.GroovyShell.evaluate(String, String)| Constructor and Description |
|---|
GroovyScriptEvaluator()
Construct a new GroovyScriptEvaluator.
|
GroovyScriptEvaluator(ClassLoader classLoader)
Construct a new GroovyScriptEvaluator.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
evaluate(ScriptSource script)
Evaluate the given script.
|
Object |
evaluate(ScriptSource script,
Map<String,Object> arguments)
Evaluate the given script with the given arguments.
|
void |
setBeanClassLoader(ClassLoader classLoader) |
public GroovyScriptEvaluator()
public GroovyScriptEvaluator(ClassLoader classLoader)
classLoader - the ClassLoader to use as a parent for the GroovyShellpublic void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader in interface org.springframework.beans.factory.BeanClassLoaderAwarepublic Object evaluate(ScriptSource script)
ScriptEvaluatorevaluate in interface ScriptEvaluatorscript - the ScriptSource for the script to evaluatepublic Object evaluate(ScriptSource script, Map<String,Object> arguments)
ScriptEvaluatorevaluate in interface ScriptEvaluatorscript - the ScriptSource for the script to evaluatearguments - the key-value pairs to expose to the script,
typically as script variables (may be null or empty)