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

    public class JavaAwareCompilationUnit
    extends CompilationUnit

Created by IntelliJ IDEA. User: Alex.Tkachman Date: May 31, 2007 Time: 6:48:28 PM

### Nested Class Summary

### Nested classes/interfaces inherited from class org.codehaus.groovy.control.CompilationUnit

`CompilationUnit.ClassgenCallback, CompilationUnit.GroovyClassOperation, CompilationUnit.PrimaryClassNodeOperation, CompilationUnit.ProgressCallback, CompilationUnit.SourceUnitOperation`

### Field Summary

### Fields inherited from class org.codehaus.groovy.control.CompilationUnit

`ast, classgenCallback, classSourcesByPublicClassName, configured, debug, generatedClasses, names, optimizer, progressCallback, queuedSources, resolveVisitor, sources, staticImportVisitor, summariesByPublicClassName, summariesBySourceName, verifier`

### Fields inherited from class org.codehaus.groovy.control.ProcessingUnit

`classLoader, configuration, errorCollector, phase, phaseComplete`

### Constructor Summary

Constructors
Constructor and Description
`JavaAwareCompilationUnit(CompilerConfiguration configuration)`
`JavaAwareCompilationUnit(CompilerConfiguration configuration, GroovyClassLoader groovyClassLoader)`

### Method Summary

Methods
`void` `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.
`JavaCompilerFactory` `getCompilerFactory()`
`void` `gotoPhase(int phase)` Wraps up any pending operations for the current phase and switches to the next phase.
`void` `setCompilerFactory(JavaCompilerFactory compilerFactory)`

### Methods inherited from class org.codehaus.groovy.control.CompilationUnit

`addClassNode, addNewPhaseOperation, addPhaseOperation, addPhaseOperation, addPhaseOperation, addSource, addSource, addSource, addSource, addSource, applyToGeneratedGroovyClasses, applyToPrimaryClassNodes, applyToSourceUnits, compile, compile, createClassVisitor, dequeued, getAST, getClasses, getClassNode, getClassSourcesByPublicClassName, getFirstClassNode, getSummariesByPublicClassName, getSummariesBySourceName, getTransformLoader, isPublicClass, iterator, mark, setClassgenCallback, setProgressCallback`

### Methods inherited from class org.codehaus.groovy.control.ProcessingUnit

`completePhase, getClassLoader, getConfiguration, getErrorCollector, getPhase, getPhaseDescription, nextPhase, setClassLoader, setConfiguration`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### JavaAwareCompilationUnit

    public JavaAwareCompilationUnit(CompilerConfiguration configuration)

#### JavaAwareCompilationUnit

    public JavaAwareCompilationUnit(CompilerConfiguration configuration,
                            GroovyClassLoader groovyClassLoader)

### Method Detail

#### gotoPhase

    public void gotoPhase(int phase)
                   throws CompilationFailedException

Description copied from class: `ProcessingUnit`
Wraps up any pending operations for the current phase and switches to the next phase.

Overrides:
  `gotoPhase` in class `ProcessingUnit`
Throws:
  `CompilationFailedException`

#### configure

    public void configure(CompilerConfiguration configuration)

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 in `URLClassLoader`.

Overrides:
  `configure` in class `CompilationUnit`

#### addSources

    public void addSources(String[] paths)

Description copied from class: `CompilationUnit`
Adds a set of file paths to the unit.

Overrides:
  `addSources` in class `CompilationUnit`

#### addSources

    public void addSources(File[] files)

Description copied from class: `CompilationUnit`
Adds a set of source files to the unit.

Overrides:
  `addSources` in class `CompilationUnit`

#### getCompilerFactory

    public JavaCompilerFactory getCompilerFactory()

#### setCompilerFactory

    public void setCompilerFactory(JavaCompilerFactory compilerFactory)