Class BshScriptEvaluator
java.lang.Object
org.springframework.scripting.bsh.BshScriptEvaluator
- All Implemented Interfaces:
- Aware,- BeanClassLoaderAware,- ScriptEvaluator
BeanShell-based implementation of Spring's 
ScriptEvaluator strategy interface.- Since:
- 4.0
- Author:
- Juergen Hoeller
- See Also:
- 
- Interpreter.eval(String)
 
- 
Constructor SummaryConstructorsConstructorDescriptionConstruct a new BshScriptEvaluator.BshScriptEvaluator(ClassLoader classLoader) Construct a new BshScriptEvaluator.
- 
Method SummaryModifier and TypeMethodDescriptionevaluate(ScriptSource script) Evaluate the given script.evaluate(ScriptSource script, Map<String, Object> arguments) Evaluate the given script with the given arguments.voidsetBeanClassLoader(ClassLoader classLoader) Callback that supplies the beanclass loaderto a bean instance.
- 
Constructor Details- 
BshScriptEvaluatorpublic BshScriptEvaluator()Construct a new BshScriptEvaluator.
- 
BshScriptEvaluatorConstruct a new BshScriptEvaluator.- Parameters:
- classLoader- the ClassLoader to use for the- Interpreter
 
 
- 
- 
Method Details- 
setBeanClassLoaderDescription copied from interface:BeanClassLoaderAwareCallback that supplies the beanclass loaderto a bean instance.Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean'sInitializingBean.afterPropertiesSet()method or a custom init-method.- Specified by:
- setBeanClassLoaderin interface- BeanClassLoaderAware
- Parameters:
- classLoader- the owning class loader
 
- 
evaluateDescription copied from interface:ScriptEvaluatorEvaluate the given script.- Specified by:
- evaluatein interface- ScriptEvaluator
- Parameters:
- script- the ScriptSource for the script to evaluate
- Returns:
- the return value of the script, if any
 
- 
evaluateDescription copied from interface:ScriptEvaluatorEvaluate the given script with the given arguments.- Specified by:
- evaluatein interface- ScriptEvaluator
- Parameters:
- script- the ScriptSource for the script to evaluate
- arguments- the key-value pairs to expose to the script, typically as script variables (may be- nullor empty)
- Returns:
- the return value of the script, if any
 
 
-