Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.groovy.control
[Java] Class ProcessingUnit

    java.lang.Object
      org.codehaus.groovy.control.ProcessingUnit

    public abstract class ProcessingUnit
    extends java.lang.Object

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

Authors:
  Chris Poirier

Version:
  \$Id\$

Field Summary
`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

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

Method Summary
`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.
`java.lang.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)`

Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Field Detail

### classLoader

    protected GroovyClassLoader classLoader

  The ClassLoader to use during processing

### configuration

    protected CompilerConfiguration configuration

  Configuration and other settings that control processing

### errorCollector

    protected ErrorCollector errorCollector

  a helper to share errors and report them

### phase

    protected int phase

  The current phase

### phaseComplete

    protected boolean phaseComplete

  Set true if phase is finished

Constructor Detail

### ProcessingUnit

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

  Initialize the ProcessingUnit to the empty state.

Method Detail

### completePhase

    public void completePhase()

  Marks the current phase complete and processes any errors.

### configure

    public void configure(CompilerConfiguration configuration)

  Reconfigures the ProcessingUnit.

### getClassLoader

    public GroovyClassLoader getClassLoader()

  Returns the class loader in use by this ProcessingUnit.

### getConfiguration

    public CompilerConfiguration getConfiguration()

### getErrorCollector

    public ErrorCollector getErrorCollector()

  Errors found during the compilation should be reported through the ErrorCollector.
  Returns:
    the ErrorCollector for this ProcessingUnit

### getPhase

    public int getPhase()

  Returns the current phase.

### getPhaseDescription

    public java.lang.String getPhaseDescription()

  Returns the description for the current phase.

### gotoPhase

    public void gotoPhase(int phase)

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

### nextPhase

    public void nextPhase()

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

### setClassLoader

    public void setClassLoader(GroovyClassLoader loader)

  Sets the class loader for use by this ProcessingUnit.

### setConfiguration

    public void setConfiguration(CompilerConfiguration configuration)

Groovy Documentation