javax.script (JSR-223) based implementation of Spring's ScriptEvaluator
strategy interface.
ScriptEngine#eval(String)
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private volatile Bindings | |
| private volatile ScriptEngineManager |
| Access | Constructor and Description |
|---|---|
| public | |
| public | StandardScriptEvaluator(ClassLoader
the class loader to use for script engine detection classLoader)Construct a new |
| public | StandardScriptEvaluator(ScriptEngineManager
the ScriptEngineManager (or subclass thereof) to use scriptEngineManager)Construct a new |
| Modifier and Type | Method and Description |
|---|---|
| public Object | evaluate(ScriptSource
the ScriptSource for the script to evaluate script)Implements org. Evaluate the given script. |
| public Object | evaluate(ScriptSource
the ScriptSource for the script to evaluate script, Map<String, Object> the key-value pairs to expose to the script,
typically as script variables (may be argumentBindings)null or empty)Implements org. Evaluate the given script with the given arguments. |
| protected ScriptEngine | Returns: the ScriptEngine (nevernull)the script to evaluate script)Obtain the JSR-223 ScriptEngine to use for the given script. |
| public void | setBeanClassLoader(ClassLoader
the owning class loader classLoader)Implements org. Callback that supplies the bean |
| public void | setEngineName(String engineName)
Set the name of the script engine for evaluating the scripts (e.g. "Groovy"), as exposed by the JSR-223 script engine factory. |
| public void | setGlobalBindings(Map<String, Object> globalBindings)
Set the globally scoped bindings on the underlying script engine manager, shared by all scripts, as an alternative to script argument bindings. |
| public void | setLanguage(String language)
Set the name of the language meant for evaluating the scripts (e.g. "Groovy"). |
| engineName | back to summary |
|---|---|
| private String engineName
| |
| globalBindings | back to summary |
|---|---|
| private volatile Bindings globalBindings
| |
| scriptEngineManager | back to summary |
|---|---|
| private volatile ScriptEngineManager scriptEngineManager
| |
| StandardScriptEvaluator | back to summary |
|---|---|
| public StandardScriptEvaluator() Construct a new | |
| StandardScriptEvaluator | back to summary |
|---|---|
| public StandardScriptEvaluator(ClassLoader classLoader) Construct a new
| |
| StandardScriptEvaluator | back to summary |
|---|---|
| public StandardScriptEvaluator(ScriptEngineManager scriptEngineManager) Construct a new
| |
| evaluate | back to summary |
|---|---|
| public Object evaluate(ScriptSource script) Implements org. Doc from org. Evaluate the given script.
| |
| evaluate | back to summary |
|---|---|
| public Object evaluate(ScriptSource script, Map<String, Object> argumentBindings) Implements org. Doc from org. Evaluate the given script with the given arguments. | |
| getScriptEngine | back to summary |
|---|---|
| protected ScriptEngine getScriptEngine(ScriptSource script) Obtain the JSR-223 ScriptEngine to use for the given script.
| |
| setBeanClassLoader | back to summary |
|---|---|
| public void setBeanClassLoader(ClassLoader classLoader) Implements org. Doc from org. Callback that supplies the bean Invoked after the population of normal bean properties but
before an initialization callback such as
| |
| setEngineName | back to summary |
|---|---|
| public void setEngineName(String engineName) Set the name of the script engine for evaluating the scripts (e.g. "Groovy"), as exposed by the JSR-223 script engine factory.
| |
| setGlobalBindings | back to summary |
|---|---|
| public void setGlobalBindings(Map<String, Object> globalBindings) Set the globally scoped bindings on the underlying script engine manager, shared by all scripts, as an alternative to script argument bindings. | |
| setLanguage | back to summary |
|---|---|
| public void setLanguage(String language) Set the name of the language meant for evaluating the scripts (e.g. "Groovy"). This is effectively an alias for
| |