类 GroovyScriptEvaluator
java.lang.Object
cn.taketoday.scripting.groovy.GroovyScriptEvaluator
- 所有已实现的接口:
Aware,BeanClassLoaderAware,ScriptEvaluator
Groovy-based implementation of Framework's
ScriptEvaluator strategy interface.- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller
- 另请参阅:
-
GroovyShell.evaluate(String, String)
-
构造器概要
构造器构造器说明Construct a new GroovyScriptEvaluator.GroovyScriptEvaluator(ClassLoader classLoader) Construct a new GroovyScriptEvaluator. -
方法概要
修饰符和类型方法说明evaluate(ScriptSource script) Evaluate the given script.evaluate(ScriptSource script, Map<String, Object> arguments) Evaluate the given script with the given arguments.org.codehaus.groovy.control.CompilerConfigurationReturn this evaluator's compiler configuration (nevernull).voidsetBeanClassLoader(ClassLoader classLoader) voidsetCompilationCustomizers(org.codehaus.groovy.control.customizers.CompilationCustomizer... compilationCustomizers) Set one or more customizers to be applied to this evaluator's compiler configuration.voidsetCompilerConfiguration(org.codehaus.groovy.control.CompilerConfiguration compilerConfiguration) Set a custom compiler configuration for this evaluator.
-
构造器详细资料
-
GroovyScriptEvaluator
public GroovyScriptEvaluator()Construct a new GroovyScriptEvaluator. -
GroovyScriptEvaluator
Construct a new GroovyScriptEvaluator.- 参数:
classLoader- the ClassLoader to use as a parent for theGroovyShell
-
-
方法详细资料
-
setCompilerConfiguration
public void setCompilerConfiguration(@Nullable org.codehaus.groovy.control.CompilerConfiguration compilerConfiguration) Set a custom compiler configuration for this evaluator. -
getCompilerConfiguration
public org.codehaus.groovy.control.CompilerConfiguration getCompilerConfiguration()Return this evaluator's compiler configuration (nevernull). -
setCompilationCustomizers
public void setCompilationCustomizers(org.codehaus.groovy.control.customizers.CompilationCustomizer... compilationCustomizers) Set one or more customizers to be applied to this evaluator's compiler configuration.Note that this modifies the shared compiler configuration held by this evaluator.
-
setBeanClassLoader
- 指定者:
setBeanClassLoader在接口中BeanClassLoaderAware
-
evaluate
从接口复制的说明:ScriptEvaluatorEvaluate the given script.- 指定者:
evaluate在接口中ScriptEvaluator- 参数:
script- the ScriptSource for the script to evaluate- 返回:
- the return value of the script, if any
-
evaluate
从接口复制的说明:ScriptEvaluatorEvaluate the given script with the given arguments.- 指定者:
evaluate在接口中ScriptEvaluator- 参数:
script- the ScriptSource for the script to evaluatearguments- the key-value pairs to expose to the script, typically as script variables (may benullor empty)- 返回:
- the return value of the script, if any
-