类 CompilerAutoConfiguration
- java.lang.Object
- org.springframework.boot.cli.compiler.CompilerAutoConfiguration
- 直接已知子类:
CachingCompilerAutoConfiguration,GroovyTemplatesCompilerAutoConfiguration,JdbcCompilerAutoConfiguration,JmsCompilerAutoConfiguration,RabbitCompilerAutoConfiguration,SpringBatchCompilerAutoConfiguration,SpringBootCompilerAutoConfiguration,SpringIntegrationCompilerAutoConfiguration,SpringMvcCompilerAutoConfiguration,SpringRetryCompilerAutoConfiguration,SpringSecurityCompilerAutoConfiguration,SpringTestCompilerAutoConfiguration,SpringWebsocketCompilerAutoConfiguration,TransactionManagementCompilerAutoConfiguration
public abstract class CompilerAutoConfiguration extends Object
Strategy that can be used to apply some auto-configuration during theCompilePhase.CONVERSIONGroovy compile phase.
构造器概要
构造器 构造器 说明 CompilerAutoConfiguration()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidapply(groovy.lang.GroovyClassLoader loader, GroovyCompilerConfiguration configuration, org.codehaus.groovy.classgen.GeneratorContext generatorContext, org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.ast.ClassNode classNode)Apply any additional configuration.voidapplyDependencies(DependencyCustomizer dependencies)Apply any dependency customizations.voidapplyImports(org.codehaus.groovy.control.customizers.ImportCustomizer imports)Apply any import customizations.voidapplyToMainClass(groovy.lang.GroovyClassLoader loader, GroovyCompilerConfiguration configuration, org.codehaus.groovy.classgen.GeneratorContext generatorContext, org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.ast.ClassNode classNode)Apply any customizations to the main class.booleanmatches(org.codehaus.groovy.ast.ClassNode classNode)Strategy method used to determine when compiler auto-configuration should be applied.
构造器详细资料
CompilerAutoConfiguration
public CompilerAutoConfiguration()
方法详细资料
matches
public boolean matches(org.codehaus.groovy.ast.ClassNode classNode)
Strategy method used to determine when compiler auto-configuration should be applied. Defaults to always.- 参数:
classNode- the class node- 返回:
trueif the compiler should be auto configured using this class. If this method returnsfalseno other strategy methods will be called.
applyDependencies
public void applyDependencies(DependencyCustomizer dependencies) throws org.codehaus.groovy.control.CompilationFailedException
Apply any dependency customizations. This method will only be called ifmatches(org.codehaus.groovy.ast.ClassNode)returnstrue.- 参数:
dependencies- dependency customizer- 抛出:
org.codehaus.groovy.control.CompilationFailedException- if the dependencies cannot be applied
applyImports
public void applyImports(org.codehaus.groovy.control.customizers.ImportCustomizer imports) throws org.codehaus.groovy.control.CompilationFailedException
Apply any import customizations. This method will only be called ifmatches(org.codehaus.groovy.ast.ClassNode)returnstrue.- 参数:
imports- import customizer- 抛出:
org.codehaus.groovy.control.CompilationFailedException- if the imports cannot be applied
applyToMainClass
public void applyToMainClass(groovy.lang.GroovyClassLoader loader, GroovyCompilerConfiguration configuration, org.codehaus.groovy.classgen.GeneratorContext generatorContext, org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.ast.ClassNode classNode) throws org.codehaus.groovy.control.CompilationFailedException
Apply any customizations to the main class. This method will only be called ifmatches(org.codehaus.groovy.ast.ClassNode)returnstrue. This method is useful when a groovy file defines more than one class but customization only applies to the first class.- 参数:
loader- the class loader being used during compilationconfiguration- the compiler configurationgeneratorContext- the current contextsource- the source unitclassNode- the main class- 抛出:
org.codehaus.groovy.control.CompilationFailedException- if the customizations cannot be applied
apply
public void apply(groovy.lang.GroovyClassLoader loader, GroovyCompilerConfiguration configuration, org.codehaus.groovy.classgen.GeneratorContext generatorContext, org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.ast.ClassNode classNode) throws org.codehaus.groovy.control.CompilationFailedException
Apply any additional configuration.- 参数:
loader- the class loader being used during compilationconfiguration- the compiler configurationgeneratorContext- the current contextsource- the source unitclassNode- the class- 抛出:
org.codehaus.groovy.control.CompilationFailedException- if the configuration cannot be applied