open class GroovyScriptFactory : ScriptFactory, BeanFactoryAware, BeanClassLoaderAware
org.springframework.scripting.ScriptFactory implementation for a Groovy script.
Typically used in combination with a org.springframework.scripting.support.ScriptFactoryPostProcessor; see the latter's javadoc for a configuration example.
Note: Spring 4.0 supports Groovy 1.8 and higher.
Author
Juergen Hoeller
Author
Rob Harrop
Author
Rod Johnson
Since
2.0
See Also
groovy.lang.GroovyClassLoaderorg.springframework.scripting.support.ScriptFactoryPostProcessor
GroovyScriptFactory(scriptSourceLocator: String)
Create a new GroovyScriptFactory for the given script source. We don't need to specify script interfaces here, since a Groovy script defines its Java interfaces itself. GroovyScriptFactory(scriptSourceLocator: String, groovyObjectCustomizer: GroovyObjectCustomizer) GroovyScriptFactory(scriptSourceLocator: String, compilerConfiguration: CompilerConfiguration)
Create a new GroovyScriptFactory for the given script source, specifying a strategy interface that can create a custom MetaClass to supply missing methods and otherwise change the behavior of the object. GroovyScriptFactory(scriptSourceLocator: String, vararg compilationCustomizers: CompilationCustomizer)
Create a new GroovyScriptFactory for the given script source, specifying a strategy interface that can customize Groovy's compilation process within the underlying GroovyClassLoader. |
open fun getGroovyClassLoader(): GroovyClassLoader
Return the GroovyClassLoader used by this script factory. |
|
open fun getScriptInterfaces(): Array<Class<*>>
Groovy scripts determine their interfaces themselves, hence we don't need to explicitly expose interfaces here. |
|
open fun getScriptSourceLocator(): String |
|
open fun getScriptedObject(scriptSource: ScriptSource, vararg actualInterfaces: Class<*>): Any
Loads and parses the Groovy script via the GroovyClassLoader. |
|
open fun getScriptedObjectType(scriptSource: ScriptSource): Class<*> |
|
open fun requiresConfigInterface(): Boolean
Groovy scripts do not need a config interface, since they expose their setters as public methods. |
|
open fun requiresScriptedObjectRefresh(scriptSource: ScriptSource): Boolean |
|
open fun setBeanClassLoader(classLoader: ClassLoader): Unit |
|
open fun setBeanFactory(beanFactory: BeanFactory): Unit |
|
open fun toString(): String |