public interface ScriptEvaluator
Modifier and Type | Method and Description |
---|---|
void |
bindVariableInGlobalScope(String name,
Object object)
Binds the given object to the given variable name in the global scope of all scripts evaluated via this
script evaluator.
|
<T> T |
evaluateScript(ScriptObject script,
Bindings bindings)
Evaluates the given script object using an appropriate script engine for the language of the script.
|
<T> T evaluateScript(ScriptObject script, Bindings bindings) throws ScriptException
bindVariableInGlobalScope(String, Object)
method,
which makes the objects visible to all script engines. This is most appropriate for stateless API objects
such as HTTP clients and other basic functionality.ScriptObject
.T
- the type of result expected from the script.script
- the script to evaluate.bindings
- any additional variable bindings to set before running the script.ScriptException
- if an error occurs evaluating the script.ClassCastException
- if the result is not of the expected type.IllegalStateException
- if no scripting engine can be located for the given scripting language.ScriptException
void bindVariableInGlobalScope(String name, Object object)
name
- the name of the variable to bind the object to.object
- the object to bind into the global scope of all scripts.NullPointerException
- if either name or object is empty.IllegalArgumentException
- if the name is an empty string.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.