org.springframework.scripting

## Interface ScriptEvaluator

- All Known Implementing Classes:
    BshScriptEvaluator, GroovyScriptEvaluator, StandardScriptEvaluator

      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.script` package (JSR-223): `StandardScriptEvaluator`.

  Since:
    4.0
  Author:
    Juergen Hoeller, Costin Leau

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `evaluate(ScriptSource script)` Evaluate the given script.
    `Object` | `evaluate(ScriptSource script, Map<String,Object> arguments)` Evaluate the given script with the given arguments.

- - ### Method Detail

    - #### evaluate

          Object evaluate(ScriptSource script)
                   throws ScriptCompilationException

      Evaluate the given script.
      Parameters:
        `script` - the ScriptSource for the script to evaluate
      Returns:
        the return value of the script, if any
      Throws:
        `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.
      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 `null`.
      Returns:
        the return value of the script, if any
      Throws:
        `ScriptCompilationException` - if the evaluator failed to read, compile or evaluate the script