Package org.codehaus.groovy.tools.javac
Class JavaAwareCompilationUnit
java.lang.Object
org.codehaus.groovy.control.ProcessingUnit
org.codehaus.groovy.control.CompilationUnit
org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit
Compilation Unit capable of compiling Java source files.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.codehaus.groovy.control.CompilationUnit
CompilationUnit.ClassgenCallback, CompilationUnit.GroovyClassOperation, CompilationUnit.IGroovyClassOperation, CompilationUnit.IPrimaryClassNodeOperation, CompilationUnit.ISourceUnitOperation, CompilationUnit.PrimaryClassNodeOperation, CompilationUnit.ProgressCallback, CompilationUnit.SourceUnitOperation
-
Field Summary
Fields inherited from class org.codehaus.groovy.control.CompilationUnit
ast, astTransformationsContext, classgenCallback, classNodeResolver, configured, debug, progressCallback, queuedSources, resolveVisitor, sources
Fields inherited from class org.codehaus.groovy.control.ProcessingUnit
classLoader, configuration, errorCollector, phase, phaseComplete
-
Constructor Summary
ConstructorDescriptionJavaAwareCompilationUnit
(CompilerConfiguration configuration) JavaAwareCompilationUnit
(CompilerConfiguration configuration, GroovyClassLoader groovyClassLoader) JavaAwareCompilationUnit
(CompilerConfiguration configuration, GroovyClassLoader groovyClassLoader, GroovyClassLoader transformClassLoader) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSources
(File[] files) Adds a set of source files to the unit.void
addSources
(String[] paths) Adds a set of file paths to the unit.void
configure
(CompilerConfiguration configuration) Configures its debugging mode and classloader classpath from a given compiler configuration.void
gotoPhase
(int phase) Wraps up any pending operations for the current phase and switches to the given phase.void
setCompilerFactory
(JavaCompilerFactory compilerFactory) Methods inherited from class org.codehaus.groovy.control.CompilationUnit
addClassNode, addFirstPhaseOperation, addFirstPhaseOperation, addJavaCompilationUnits, addNewPhaseOperation, addNewPhaseOperation, addPhaseOperation, addPhaseOperation, addPhaseOperation, addPhaseOperation, addPhaseOperation, addPhaseOperation, addSource, addSource, addSource, addSource, addSource, applyToPrimaryClassNodes, applyToSourceUnits, compile, compile, createClassVisitor, dequeued, getAST, getASTTransformationsContext, getClasses, getClassgenCallback, getClassNode, getClassNodeResolver, getFirstClassNode, getJavaCompilationUnitSet, getProgressCallback, getTransformLoader, iterator, mark, setClassgenCallback, setClassNodeResolver, setProgressCallback
Methods inherited from class org.codehaus.groovy.control.ProcessingUnit
completePhase, getClassLoader, getConfiguration, getErrorCollector, getPhase, getPhaseDescription, isPhaseComplete, nextPhase, setClassLoader, setConfiguration
-
Constructor Details
-
JavaAwareCompilationUnit
public JavaAwareCompilationUnit() -
JavaAwareCompilationUnit
-
JavaAwareCompilationUnit
public JavaAwareCompilationUnit(CompilerConfiguration configuration, GroovyClassLoader groovyClassLoader) -
JavaAwareCompilationUnit
public JavaAwareCompilationUnit(CompilerConfiguration configuration, GroovyClassLoader groovyClassLoader, GroovyClassLoader transformClassLoader)
-
-
Method Details
-
gotoPhase
Description copied from class:ProcessingUnit
Wraps up any pending operations for the current phase and switches to the given phase.- Overrides:
gotoPhase
in classProcessingUnit
- Throws:
CompilationFailedException
-
configure
Description copied from class:CompilationUnit
Configures its debugging mode and classloader classpath from a given compiler configuration. This cannot be done more than once due to limitations inURLClassLoader
.- Overrides:
configure
in classCompilationUnit
-
addSources
Description copied from class:CompilationUnit
Adds a set of file paths to the unit.- Overrides:
addSources
in classCompilationUnit
-
addSources
Description copied from class:CompilationUnit
Adds a set of source files to the unit.- Overrides:
addSources
in classCompilationUnit
-
getCompilerFactory
-
setCompilerFactory
-