Consistent support for CompilationCustomizers as well as custom CompilerConfiguration

Issue: SPR-14585
This commit is contained in:
Juergen Hoeller
2016-08-17 11:29:49 +02:00
parent a1b167a988
commit 6a0d9d3d97
6 changed files with 128 additions and 10 deletions

View File

@@ -39,8 +39,8 @@ class GroovyCalculator implements Calculator {
<lang:groovy id="groovyObjectCustomizer" customizer-ref="importCustomizer">
<lang:inline-script><![CDATA[
public class TestCustomizer implements GroovyObjectCustomizer {
public void customize(GroovyObject o) {
println "customizing ${o}.."
public void customize(GroovyObject go) {
println "customizing ${go}..."
}
}]]>
</lang:inline-script>
@@ -53,8 +53,15 @@ public class TestCustomizer implements GroovyObjectCustomizer {
<lang:property name="message" value="Hello World!"/>
</lang:groovy>
<lang:groovy script-source="classpath:org/springframework/scripting/groovy/Messenger.groovy">
<lang:groovy script-source="classpath:org/springframework/scripting/groovy/Messenger.groovy"
customizer-ref="compilerConfiguration">
<lang:property name="message" value="Hello World!"/>
</lang:groovy>
<bean id="compilerConfiguration" class="org.codehaus.groovy.control.CompilerConfiguration">
<property name="bytecodePostprocessor" ref="bytecodeProcessor"/>
</bean>
<bean id="bytecodeProcessor" class="org.springframework.scripting.groovy.MyBytecodeProcessor"/>
</beans>