public abstract class CompilerAutoConfiguration extends java.lang.Object
Strategy that can be used to apply some auto-configuration during the org.codehaus.groovy.control.CompilePhase#CONVERSION Groovy compile phase.
| Type Params | Return Type | Name and description |
|---|---|---|
|
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)Apply any additional configuration. |
|
public void |
applyDependencies(DependencyCustomizer dependencies)Apply any dependency customizations. |
|
public void |
applyImports(org.codehaus.groovy.control.customizers.ImportCustomizer imports)Apply any import customizations. |
|
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)Apply any customizations to the main class. |
|
public boolean |
matches(org.codehaus.groovy.ast.ClassNode classNode)Strategy method used to determine when compiler auto-configuration should be applied. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
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.