public abstract class CompilerAutoConfiguration extends Object
CompilePhase.CONVERSION
Groovy compile phase.Constructor and Description |
---|
CompilerAutoConfiguration() |
Modifier and Type | Method and Description |
---|---|
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.
|
void |
applyDependencies(DependencyCustomizer dependencies)
Apply any dependency customizations.
|
void |
applyImports(org.codehaus.groovy.control.customizers.ImportCustomizer imports)
Apply any import customizations.
|
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.
|
boolean |
matches(org.codehaus.groovy.ast.ClassNode classNode)
Strategy method used to determine when compiler auto-configuration should be
applied.
|
public boolean matches(org.codehaus.groovy.ast.ClassNode classNode)
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.public void applyDependencies(DependencyCustomizer dependencies) throws org.codehaus.groovy.control.CompilationFailedException
matches(org.codehaus.groovy.ast.ClassNode)
returns true
.dependencies
- dependency customizerorg.codehaus.groovy.control.CompilationFailedException
- if the dependencies cannot be appliedpublic void applyImports(org.codehaus.groovy.control.customizers.ImportCustomizer imports) throws org.codehaus.groovy.control.CompilationFailedException
matches(org.codehaus.groovy.ast.ClassNode)
returns true
.imports
- import customizerorg.codehaus.groovy.control.CompilationFailedException
- if the imports cannot be appliedpublic 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
matches(org.codehaus.groovy.ast.ClassNode)
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 classorg.codehaus.groovy.control.CompilationFailedException
- if the customizations cannot be appliedpublic 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
loader
- the class loader being used during compilationconfiguration
- the compiler configurationgeneratorContext
- the current contextsource
- the source unitclassNode
- the classorg.codehaus.groovy.control.CompilationFailedException
- if the configuration cannot be applied