Class ScriptEngineScriptEvaluator
java.lang.Object
org.hibernate.validator.spi.scripting.ScriptEngineScriptEvaluator
- All Implemented Interfaces:
ScriptEvaluator
A wrapper around JSR 223
ScriptEngine
s. This class is thread-safe.- Since:
- 6.0.3
- Author:
- Gunnar Morling, Kevin Pollet <kevin.pollet@serli.com> (C) 2011 SERLI
-
Constructor Summary
ConstructorDescriptionCreates a new script executor. -
Method Summary
-
Constructor Details
-
ScriptEngineScriptEvaluator
Creates a new script executor.- Parameters:
engine
- the engine to be wrapped
-
-
Method Details
-
evaluate
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.- Specified by:
evaluate
in interfaceScriptEvaluator
- Parameters:
script
- the script to be executedbindings
- the bindings to be used- Returns:
- the script's result
- Throws:
ScriptEvaluationException
- in case an error occurred during the script evaluation
-