接口 ScriptEvaluator
public interface ScriptEvaluator
Spring's strategy interface for evaluating a script.Aside from language-specific implementations, Spring also ships a version based on the standard
javax.scriptpackage (JSR-223):StandardScriptEvaluator.- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller, Costin Leau
方法详细资料
evaluate
Object evaluate(ScriptSource script) throws ScriptCompilationException
Evaluate the given script.- 参数:
script- the ScriptSource for the script to evaluate- 返回:
- the return value of the script, if any
- 抛出:
ScriptCompilationException- if the evaluator failed to read, compile or evaluate the script
evaluate
Object evaluate(ScriptSource script, Map<String,Object> arguments) throws ScriptCompilationException
Evaluate the given script with the given arguments.- 参数:
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
- 抛出:
ScriptCompilationException- if the evaluator failed to read, compile or evaluate the script