Class StandardScriptUtils
- java.lang.Object
- org.springframework.scripting.support.StandardScriptUtils
public abstract class StandardScriptUtils extends Object
Common operations for dealing with a JSR-223ScriptEngine
.- Since:
- 4.2.2
- Author:
- Juergen Hoeller
Constructor Summary
Constructors Constructor Description StandardScriptUtils()
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ScriptEngine
retrieveEngineByName(ScriptEngineManager scriptEngineManager, String engineName)
Retrieve aScriptEngine
from the givenScriptEngineManager
by name, delegating toScriptEngineManager.getEngineByName(java.lang.String)
but throwing a descriptive exception if not found or if initialization failed.
Constructor Detail
StandardScriptUtils
public StandardScriptUtils()
Method Detail
retrieveEngineByName
public static ScriptEngine retrieveEngineByName(ScriptEngineManager scriptEngineManager, String engineName)
Retrieve aScriptEngine
from the givenScriptEngineManager
by name, delegating toScriptEngineManager.getEngineByName(java.lang.String)
but throwing a descriptive exception if not found or if initialization failed.- Parameters:
scriptEngineManager
- the ScriptEngineManager to useengineName
- the name of the engine- Returns:
- a corresponding ScriptEngine (never
null
) - Throws:
IllegalArgumentException
- if no matching engine has been foundIllegalStateException
- if the desired engine failed to initialize