类 BshScriptEvaluator
- java.lang.Object
- org.springframework.scripting.bsh.BshScriptEvaluator
- 所有已实现的接口:
Aware,BeanClassLoaderAware,ScriptEvaluator
public class BshScriptEvaluator extends Object implements ScriptEvaluator, BeanClassLoaderAware
BeanShell-based implementation of Spring'sScriptEvaluatorstrategy interface.- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller
- 另请参阅:
Interpreter.eval(String)
构造器概要
构造器 构造器 说明 BshScriptEvaluator()Construct a new BshScriptEvaluator.BshScriptEvaluator(ClassLoader classLoader)Construct a new BshScriptEvaluator.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Objectevaluate(ScriptSource script)Evaluate the given script.Objectevaluate(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.
构造器详细资料
BshScriptEvaluator
public BshScriptEvaluator()
Construct a new BshScriptEvaluator.
BshScriptEvaluator
public BshScriptEvaluator(ClassLoader classLoader)
Construct a new BshScriptEvaluator.- 参数:
classLoader- the ClassLoader to use for theInterpreter
方法详细资料
setBeanClassLoader
public void setBeanClassLoader(ClassLoader classLoader)
从接口复制的说明: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.- 指定者:
setBeanClassLoader在接口中BeanClassLoaderAware- 参数:
classLoader- the owning class loader
evaluate
@Nullable public Object evaluate(ScriptSource script)
从接口复制的说明:ScriptEvaluatorEvaluate the given script.- 指定者:
evaluate在接口中ScriptEvaluator- 参数:
script- the ScriptSource for the script to evaluate- 返回:
- the return value of the script, if any
evaluate
@Nullable public Object evaluate(ScriptSource script, @Nullable Map<String,Object> arguments)
从接口复制的说明:ScriptEvaluatorEvaluate the given script with the given arguments.- 指定者:
evaluate在接口中ScriptEvaluator- 参数:
script- the ScriptSource for the script to evaluatearguments- the key-value pairs to expose to the script, typically as script variables (may benullor empty)- 返回:
- the return value of the script, if any