Package: org.codehaus.groovy.control

## [Java] Class ProcessingUnit

- org.codehaus.groovy.control.ProcessingUnit

- A base class for data structures that can collect messages and errors during processing.

  Authors:
    Chris Poirier

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `protected GroovyClassLoader` | `classLoader` | The ClassLoader to use during processing
    `protected CompilerConfiguration` | `configuration` | Configuration and other settings that control processing
    `protected ErrorCollector` | `errorCollector` | a helper to share errors and report them
    `protected int` | `phase` | The current phase
    `protected boolean` | `phaseComplete` | Set true if phase is finished

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `GroovyClassLoader` | `classLoader`
    `CompilerConfiguration` | `configuration`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `ProcessingUnit (CompilerConfiguration configuration, GroovyClassLoader classLoader, ErrorCollector er)` Initialize the ProcessingUnit to the empty state.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `void` | `completePhase()` Marks the current phase complete and processes any errors.
    `` | `void` | `configure(CompilerConfiguration configuration)` Reconfigures the ProcessingUnit.
    `` | `GroovyClassLoader` | `getClassLoader()` Returns the class loader in use by this ProcessingUnit.
    `` | `CompilerConfiguration` | `getConfiguration()`
    `` | `ErrorCollector` | `getErrorCollector()` Errors found during the compilation should be reported through the ErrorCollector.
    `` | `int` | `getPhase()` Returns the current phase.
    `` | `String` | `getPhaseDescription()` Returns the description for the current phase.
    `` | `void` | `gotoPhase(int phase)` Wraps up any pending operations for the current phase and switches to the next phase.
    `` | `void` | `nextPhase()` A synonym for `gotoPhase( phase + 1 )`.
    `` | `void` | `setClassLoader(GroovyClassLoader loader)` Sets the class loader for use by this ProcessingUnit.
    `` | `void` | `setConfiguration(CompilerConfiguration configuration)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Field Detail

    - #### protected GroovyClassLoader classLoader

      The ClassLoader to use during processing

    - #### protected CompilerConfiguration configuration

      Configuration and other settings that control processing

    - #### protected ErrorCollector errorCollector

      a helper to share errors and report them

    - #### protected int phase

      The current phase

    - #### protected boolean phaseComplete

      Set true if phase is finished

  - ### Property Detail

    - #### GroovyClassLoader classLoader

    - #### CompilerConfiguration configuration

  - ### Constructor Detail

    - #### public ProcessingUnit(CompilerConfiguration configuration, GroovyClassLoader classLoader, ErrorCollector er)

      Initialize the ProcessingUnit to the empty state.

  - ### Method Detail

    - #### public void completePhase()

      Marks the current phase complete and processes any errors.

    - #### public void configure(CompilerConfiguration configuration)

      Reconfigures the ProcessingUnit.

    - #### public GroovyClassLoader getClassLoader()

      Returns the class loader in use by this ProcessingUnit.

    - #### public CompilerConfiguration getConfiguration()

    - #### public ErrorCollector getErrorCollector()

      Errors found during the compilation should be reported through the ErrorCollector.

      Returns:
        the ErrorCollector for this ProcessingUnit

    - #### public int getPhase()

      Returns the current phase.

    - #### public String getPhaseDescription()

      Returns the description for the current phase.

    - #### public void gotoPhase(int phase)

      Wraps up any pending operations for the current phase and switches to the next phase.

    - #### public void nextPhase()

      A synonym for `gotoPhase( phase + 1 )`.

    - #### public void setClassLoader(GroovyClassLoader loader)

      Sets the class loader for use by this ProcessingUnit.

    - #### public void setConfiguration(CompilerConfiguration configuration)