类 GroovyScriptFactory

    • 构造器详细资料

      • 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,
                                   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)
        另请参阅:
        GroovyObjectCustomizer.customize(groovy.lang.GroovyObject)
      • GroovyScriptFactory

        public GroovyScriptFactory​(String scriptSourceLocator,
                                   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)
        从以下版本开始:
        4.3.3
        另请参阅:
        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
        从以下版本开始:
        4.3.3
        另请参阅:
        CompilerConfiguration.addCompilationCustomizers(org.codehaus.groovy.control.customizers.CompilationCustomizer...), ImportCustomizer