public class BshScriptEvaluator extends java.lang.Object implements ScriptEvaluator, org.springframework.beans.factory.BeanClassLoaderAware
ScriptEvaluator
strategy interface.Interpreter.eval(String)
Constructor and Description |
---|
BshScriptEvaluator()
Construct a new BshScriptEvaluator.
|
BshScriptEvaluator(java.lang.ClassLoader classLoader)
Construct a new BshScriptEvaluator.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
evaluate(ScriptSource script)
Evaluate the given script.
|
java.lang.Object |
evaluate(ScriptSource script,
java.util.Map<java.lang.String,java.lang.Object> arguments)
Evaluate the given script with the given arguments.
|
void |
setBeanClassLoader(java.lang.ClassLoader classLoader) |
public BshScriptEvaluator()
public BshScriptEvaluator(java.lang.ClassLoader classLoader)
classLoader
- the ClassLoader to use for the Interpreter
public void setBeanClassLoader(java.lang.ClassLoader classLoader)
setBeanClassLoader
in interface org.springframework.beans.factory.BeanClassLoaderAware
public java.lang.Object evaluate(ScriptSource script)
ScriptEvaluator
evaluate
in interface ScriptEvaluator
script
- the ScriptSource for the script to evaluatepublic java.lang.Object evaluate(ScriptSource script, java.util.Map<java.lang.String,java.lang.Object> arguments)
ScriptEvaluator
evaluate
in interface ScriptEvaluator
script
- 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)