public class GroovyCompiler
extends java.lang.Object
GroovyClassLoader.parseClass(GroovyCodeSource) with the following additional
features:
CompilerAutoConfiguration strategies will be read from
META-INF/services/org.springframework.boot.cli.compiler.CompilerAutoConfiguration
(per the standard java ServiceLoader contract) and applied during compilation
ClassLoader.getResource(String)| Constructor and Description |
|---|
GroovyCompiler(GroovyCompilerConfiguration configuration)
Create a new
GroovyCompiler instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
addCompilationCustomizers(org.codehaus.groovy.control.customizers.CompilationCustomizer... customizers) |
java.lang.Class<?>[] |
compile(java.lang.String... sources)
Compile the specified Groovy sources, applying any
CompilerAutoConfigurations. |
java.util.List<org.codehaus.groovy.transform.ASTTransformation> |
getAstTransformations()
Return a mutable list of the
ASTTransformations to be applied during
compile(String...). |
ExtendedGroovyClassLoader |
getLoader() |
public GroovyCompiler(GroovyCompilerConfiguration configuration)
GroovyCompiler instance.configuration - the compiler configurationpublic java.util.List<org.codehaus.groovy.transform.ASTTransformation> getAstTransformations()
ASTTransformations to be applied during
compile(String...).public ExtendedGroovyClassLoader getLoader()
public void addCompilationCustomizers(org.codehaus.groovy.control.customizers.CompilationCustomizer... customizers)
public java.lang.Class<?>[] compile(java.lang.String... sources)
throws org.codehaus.groovy.control.CompilationFailedException,
java.io.IOException
CompilerAutoConfigurations. All classes defined in the sources will be
returned from this method.sources - the sources to compileorg.codehaus.groovy.control.CompilationFailedException - in case of compilation failuresjava.io.IOException - in case of I/O errorsorg.codehaus.groovy.control.CompilationFailedException - in case of compilation errors