public abstract class CompilerAutoConfiguration extends Object
Strategy that can be used to apply some auto-configuration during the CompilePhase.CONVERSION Groovy compile phase.
Type Params | Return Type | Name and description |
---|---|---|
|
public void |
apply(GroovyClassLoader loader, GroovyCompilerConfiguration configuration, GeneratorContext generatorContext, SourceUnit source, ClassNode classNode) Apply any additional configuration. |
|
public void |
applyDependencies(DependencyCustomizer dependencies) Apply any dependency customizations. |
|
public void |
applyImports(ImportCustomizer imports) Apply any import customizations. |
|
public void |
applyToMainClass(GroovyClassLoader loader, GroovyCompilerConfiguration configuration, GeneratorContext generatorContext, SourceUnit source, ClassNode classNode) Apply any customizations to the main class. |
|
public boolean |
matches(ClassNode classNode) Strategy method used to determine when compiler auto-configuration should be applied. |
Apply any additional configuration.
loader
- the class loader being used during compilationconfiguration
- the compiler configurationgeneratorContext
- the current contextsource
- the source unitclassNode
- the class Apply any dependency customizations. This method will only be called if
matches returns true
.
dependencies
- dependency customizer Apply any import customizations. This method will only be called if
matches returns true
.
imports
- import customizer Apply any customizations to the main class. This method will only be called if
matches returns true
. 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 classStrategy method used to determine when compiler auto-configuration should be applied. Defaults to always.
classNode
- the class nodetrue
if the compiler should be auto-configured using this class. If
this method returns false
no other strategy methods will be called.