org.hibernate.validator.internal.util.scriptengine

## Class ScriptEvaluator

- java.lang.Object
- - org.hibernate.validator.internal.util.scriptengine.ScriptEvaluator

-     public class ScriptEvaluator
      extends Object

  A wrapper around JSR 223 `ScriptEngine`s. This class is thread-safe.
  Author:
    Gunnar Morling, Kevin Pollet (C) 2011 SERLI

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ScriptEvaluator(ScriptEngine engine)` Creates a new script executor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `evaluate(String script, Map<String,Object> bindings)` Executes the given script, using the given variable bindings.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ScriptEvaluator

          public ScriptEvaluator(ScriptEngine engine)

      Creates a new script executor.
      Parameters:
        `engine` - The engine to be wrapped.

  - ### Method Detail

    - #### evaluate

          public Object evaluate(String script,
                        Map<String,Object> bindings)
                          throws ScriptException

      Executes the given script, using the given variable bindings. The execution of the script happens either synchronized or unsynchronized, depending on the engine's threading abilities.
      Parameters:
        `script` - The script to be executed.
        `bindings` - The bindings to be used.
      Returns:
        The script's result.
      Throws:
        `ScriptException` - In case of any errors during script execution.

Copyright © 2007-2014 Red Hat, Inc. All Rights Reserved