类 GroovyScriptFactory

java.lang.Object
cn.taketoday.scripting.groovy.GroovyScriptFactory
所有已实现的接口:
Aware, BeanClassLoaderAware, BeanFactoryAware, ScriptFactory

public class GroovyScriptFactory extends Object implements ScriptFactory, BeanFactoryAware, BeanClassLoaderAware
ScriptFactory implementation for a Groovy script.

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

supports Groovy 1.8 and higher.

从以下版本开始:
4.0
作者:
Juergen Hoeller, Rob Harrop, Rod Johnson
另请参阅:
  • 构造器详细资料

    • GroovyScriptFactory

      public GroovyScriptFactory(String scriptSourceLocator)
      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.

      参数:
      scriptSourceLocator - a locator that points to the source of the script. Interpreted by the post-processor that actually creates the script.
    • GroovyScriptFactory

      public GroovyScriptFactory(String scriptSourceLocator, @Nullable GroovyObjectCustomizer groovyObjectCustomizer)
      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.
      参数:
      scriptSourceLocator - a locator that points to the source of the script. Interpreted by the post-processor that actually creates the script.
      groovyObjectCustomizer - a customizer that can set a custom metaclass or make other changes to the GroovyObject created by this factory (may be null)
      另请参阅:
    • GroovyScriptFactory

      public GroovyScriptFactory(String scriptSourceLocator, @Nullable org.codehaus.groovy.control.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.
      参数:
      scriptSourceLocator - a locator that points to the source of the script. Interpreted by the post-processor that actually creates the script.
      compilerConfiguration - a custom compiler configuration to be applied to the GroovyClassLoader (may be null)
      另请参阅:
      • GroovyClassLoader(ClassLoader, CompilerConfiguration)
    • GroovyScriptFactory

      public GroovyScriptFactory(String scriptSourceLocator, org.codehaus.groovy.control.customizers.CompilationCustomizer... compilationCustomizers)
      Create a new GroovyScriptFactory for the given script source, specifying a strategy interface that can customize Groovy's compilation process within the underlying GroovyClassLoader.
      参数:
      scriptSourceLocator - a locator that points to the source of the script. Interpreted by the post-processor that actually creates the script.
      compilationCustomizers - one or more customizers to be applied to the GroovyClassLoader compiler configuration
      另请参阅:
      • CompilerConfiguration.addCompilationCustomizers(org.codehaus.groovy.control.customizers.CompilationCustomizer...)
      • ImportCustomizer
  • 方法详细资料