Class StandardScriptUtils
java.lang.Object
org.springframework.scripting.support.StandardScriptUtils
Common operations for dealing with a JSR-223 
ScriptEngine.- Since:
- 4.2.2
- Author:
- Juergen Hoeller
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic ScriptEngineretrieveEngineByName(ScriptEngineManager scriptEngineManager, String engineName) Retrieve aScriptEnginefrom the givenScriptEngineManagerby name, delegating toScriptEngineManager.getEngineByName(java.lang.String)but throwing a descriptive exception if not found or if initialization failed.
- 
Constructor Details- 
StandardScriptUtilspublic StandardScriptUtils()
 
- 
- 
Method Details- 
retrieveEngineByNamepublic static ScriptEngine retrieveEngineByName(ScriptEngineManager scriptEngineManager, String engineName) Retrieve aScriptEnginefrom the givenScriptEngineManagerby name, delegating toScriptEngineManager.getEngineByName(java.lang.String)but throwing a descriptive exception if not found or if initialization failed.- Parameters:
- scriptEngineManager- the ScriptEngineManager to use
- engineName- the name of the engine
- Returns:
- a corresponding ScriptEngine (never null)
- Throws:
- IllegalArgumentException- if no matching engine has been found
- IllegalStateException- if the desired engine failed to initialize
 
 
-