spring-framework / org.springframework.scripting.support / StandardScriptUtils / retrieveEngineByName

retrieveEngineByName

open static fun retrieveEngineByName(scriptEngineManager: ScriptEngineManager, engineName: String): ScriptEngine

Retrieve a ScriptEngine from the given ScriptEngineManager by name, delegating to ScriptEngineManager#getEngineByName but throwing a descriptive exception if not found or if initialization failed.

Parameters

scriptEngineManager - the ScriptEngineManager to use

engineName - the name of the engine

Exceptions

IllegalArgumentException - if no matching engine has been found

IllegalStateException - if the desired engine failed to initialize

Return
a corresponding ScriptEngine (never null)