spring-framework / org.springframework.scripting.support / StandardScriptFactory

StandardScriptFactory

open class StandardScriptFactory : ScriptFactory, BeanClassLoaderAware

org.springframework.scripting.ScriptFactory implementation based on the JSR-223 script engine abstraction (as included in Java 6+). Supports JavaScript, Groovy, JRuby and other JSR-223 compliant engines.

Typically used in combination with a org.springframework.scripting.support.ScriptFactoryPostProcessor; see the latter's javadoc for a configuration example.

Author
Juergen Hoeller

Since
4.2

See Also
ScriptFactoryPostProcessor

Constructors

<init>

StandardScriptFactory(scriptSourceLocator: String)
StandardScriptFactory(scriptSourceLocator: String, vararg scriptInterfaces: Class<*>)
StandardScriptFactory(scriptEngineName: String, scriptSourceLocator: String)
StandardScriptFactory(scriptEngineName: String, scriptSourceLocator: String, vararg scriptInterfaces: Class<*>)

Create a new StandardScriptFactory for the given script source.

Functions

getScriptInterfaces

open fun getScriptInterfaces(): Array<Class<*>>

getScriptSourceLocator

open fun getScriptSourceLocator(): String

getScriptedObject

open fun getScriptedObject(scriptSource: ScriptSource, vararg actualInterfaces: Class<*>): Any

Load and parse the script via JSR-223's ScriptEngine.

getScriptedObjectType

open fun getScriptedObjectType(scriptSource: ScriptSource): Class<*>

requiresConfigInterface

open fun requiresConfigInterface(): Boolean

requiresScriptedObjectRefresh

open fun requiresScriptedObjectRefresh(scriptSource: ScriptSource): Boolean

setBeanClassLoader

open fun setBeanClassLoader(classLoader: ClassLoader): Unit

toString

open fun toString(): String