public class GroovyCompiler extends ObjectSE
GroovyClassLoader.parseClass(GroovyCodeSource)
のシンプルなファサード。CompilerAutoConfiguration
戦略は META-INF/services/org.springframework.boot.cli.compiler.CompilerAutoConfiguration
から読み取られ(標準の java ServiceLoader
SE 契約に従って)、コンパイル中に適用されます ClassLoader.getResource(String)
SE を使用してロードすることもできます。コンストラクターと説明 |
---|
GroovyCompiler(GroovyCompilerConfiguration configuration) 新しい GroovyCompiler インスタンスを作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
void | addCompilationCustomizers(org.codehaus.groovy.control.customizers.CompilationCustomizer... customizers) |
ClassSE<?>[] | compile(StringSE... sources) 指定された Groovy ソースをコンパイルし、任意の CompilerAutoConfiguration を適用します。 |
ListSE<org.codehaus.groovy.transform.ASTTransformation> | getAstTransformations() compile(String...) 中に適用される ASTTransformation の可変リストを返します。 |
ExtendedGroovyClassLoader | getLoader() |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public GroovyCompiler(GroovyCompilerConfiguration configuration)
GroovyCompiler
インスタンスを作成します。configuration
- コンパイラー構成 public ListSE<org.codehaus.groovy.transform.ASTTransformation> getAstTransformations()
compile(String...)
中に適用される ASTTransformation
の可変リストを返します。public ExtendedGroovyClassLoader getLoader()
public void addCompilationCustomizers(org.codehaus.groovy.control.customizers.CompilationCustomizer... customizers)
public ClassSE<?>[] compile(StringSE... sources) throws org.codehaus.groovy.control.CompilationFailedException, IOExceptionSE
CompilerAutoConfiguration
を適用します。ソースで定義されているすべてのクラスは、このメソッドから返されます。sources
- コンパイルするソース org.codehaus.groovy.control.CompilationFailedException
- コンパイルに失敗した場合 IOExceptionSE
- I/O エラーの場合 org.codehaus.groovy.control.CompilationFailedException
- コンパイルエラーの場合