接口 ScriptEvaluator
public interface ScriptEvaluator
Framework's strategy interface for evaluating a script.
Aside from language-specific implementations, Framework also ships
a version based on the standard javax.script package (JSR-223):
StandardScriptEvaluator.
- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller, Costin Leau
-
方法概要
修饰符和类型方法说明evaluate(ScriptSource script) Evaluate the given script.evaluate(ScriptSource script, Map<String, Object> arguments) Evaluate the given script with the given arguments.
-
方法详细资料
-
evaluate
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
@Nullable Object evaluate(ScriptSource script, @Nullable Map<String, Object> arguments) throws ScriptCompilationExceptionEvaluate 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
-