Top Description Methods
org.hibernate.validator.spi.scripting

public Interface ScriptEvaluator

Known Direct Implementers
org.hibernate.validator.spi.scripting.ScriptEngineScriptEvaluator
Annotations
@Incubating
Imports
java.util.Map, javax.script.ScriptEngine, org.hibernate.validator.Incubating, org.hibernate.validator.constraints.ParameterScriptAssert, .ScriptAssert

Used to evaluate script expressions for ScriptAssert and ParameterScriptAssert constraints.

The default implementation ScriptEngineScriptEvaluator is a wrapper around JSR 223 ScriptEngines. It can also be any user specific implementation.

Author
Marko Bekhta
Since
6.0.3

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

the result of script evaluation
evaluate
(String
a script to evaluate
script
,
Map<String, Object>
the bindings to be used
bindings
)

Evaluates a script expression and returns the result of this evaluation.

Method Detail

evaluateback to summary
public Object evaluate(String script, Map<String, Object> bindings) throws ScriptEvaluationException

Evaluates a script expression and returns the result of this evaluation.

Parameters
script:String

a script to evaluate

bindings:Map<String, Object>

the bindings to be used

Returns:Object

the result of script evaluation

Exceptions
ScriptEvaluationException:
in case an error occurred during the script evaluation