Class GroovyScriptEvaluator
java.lang.Object
org.springframework.scripting.groovy.GroovyScriptEvaluator
- All Implemented Interfaces:
- org.springframework.beans.factory.Aware,- org.springframework.beans.factory.BeanClassLoaderAware,- ScriptEvaluator
public class GroovyScriptEvaluator
extends Object
implements ScriptEvaluator, org.springframework.beans.factory.BeanClassLoaderAware
Groovy-based implementation of Spring's 
ScriptEvaluator strategy interface.- Since:
- 4.0
- Author:
- Juergen Hoeller
- See Also:
- 
- GroovyShell.evaluate(String, String)
 
- 
Constructor SummaryConstructorsConstructorDescriptionConstruct a new GroovyScriptEvaluator.GroovyScriptEvaluator(ClassLoader classLoader) Construct a new GroovyScriptEvaluator.
- 
Method SummaryModifier and TypeMethodDescriptionevaluate(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.
- 
Constructor Details- 
GroovyScriptEvaluatorpublic GroovyScriptEvaluator()Construct a new GroovyScriptEvaluator.
- 
GroovyScriptEvaluatorConstruct a new GroovyScriptEvaluator.- Parameters:
- classLoader- the ClassLoader to use as a parent for the- GroovyShell
 
 
- 
- 
Method Details- 
setCompilerConfigurationpublic void setCompilerConfiguration(@Nullable org.codehaus.groovy.control.CompilerConfiguration compilerConfiguration) Set a custom compiler configuration for this evaluator.- Since:
- 4.3.3
- See Also:
 
- 
getCompilerConfigurationpublic org.codehaus.groovy.control.CompilerConfiguration getCompilerConfiguration()Return this evaluator's compiler configuration (nevernull).- Since:
- 4.3.3
- See Also:
 
- 
setCompilationCustomizerspublic 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. - Since:
- 4.3.3
- See Also:
 
- 
setBeanClassLoader- Specified by:
- setBeanClassLoaderin interface- org.springframework.beans.factory.BeanClassLoaderAware
 
- 
evaluateDescription copied from interface:ScriptEvaluatorEvaluate the given script.- Specified by:
- evaluatein interface- ScriptEvaluator
- Parameters:
- script- the ScriptSource for the script to evaluate
- Returns:
- the return value of the script, if any
 
- 
evaluateDescription copied from interface:ScriptEvaluatorEvaluate the given script with the given arguments.- Specified by:
- evaluatein interface- ScriptEvaluator
- Parameters:
- script- the ScriptSource for the script to evaluate
- arguments- the key-value pairs to expose to the script, typically as script variables (may be- nullor empty)
- Returns:
- the return value of the script, if any
 
 
-