接口 ScriptEvaluator

所有已知实现类:
BshScriptEvaluator, GroovyScriptEvaluator, StandardScriptEvaluator

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

      @Nullable 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

      @Nullable Object evaluate(ScriptSource script, @Nullable Map<String,Object> arguments) throws ScriptCompilationException
      Evaluate the given script with the given arguments.
      参数:
      script - the ScriptSource for the script to evaluate
      arguments - the key-value pairs to expose to the script, typically as script variables (may be null or empty)
      返回:
      the return value of the script, if any
      抛出:
      ScriptCompilationException - if the evaluator failed to read, compile or evaluate the script