spring-framework / org.springframework.scripting.bsh / BshScriptFactory

BshScriptFactory

open class BshScriptFactory : ScriptFactory, BeanClassLoaderAware

org.springframework.scripting.ScriptFactory implementation for a BeanShell script.

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

Author
Juergen Hoeller

Author
Rob Harrop

Since
2.0

See Also
BshScriptUtilsorg.springframework.scripting.support.ScriptFactoryPostProcessor

Constructors

<init>

BshScriptFactory(scriptSourceLocator: String)

Create a new BshScriptFactory for the given script source.

With this BshScriptFactory variant, the script needs to declare a full class or return an actual instance of the scripted object.

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

Create a new BshScriptFactory for the given script source.

The script may either be a simple script that needs a corresponding proxy generated (implementing the specified interfaces), or declare a full class or return an actual instance of the scripted object (in which case the specified interfaces, if any, need to be implemented by that class/instance).

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 BeanShell script via BshScriptUtils.

getScriptedObjectType

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

requiresConfigInterface

open fun requiresConfigInterface(): Boolean

BeanShell scripts do require a config interface.

requiresScriptedObjectRefresh

open fun requiresScriptedObjectRefresh(scriptSource: ScriptSource): Boolean

setBeanClassLoader

open fun setBeanClassLoader(classLoader: ClassLoader): Unit

toString

open fun toString(): String