Top Description Fields Constructors Methods
org.codehaus.groovy.control

public abstract Class ProcessingUnit

extends Object
Class Inheritance
Known Direct Subclasses
org.codehaus.groovy.control.SourceUnit, org.codehaus.groovy.control.CompilationUnit
Imports
groovy.lang.GroovyClassLoader, java.security.AccessController, .PrivilegedAction

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

Field Summary

Modifier and TypeField and 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

True if phase is finished

Constructor Summary

AccessConstructor and Description
public
ProcessingUnit(final CompilerConfiguration configuration, final GroovyClassLoader classLoader, final ErrorCollector errorCollector)

Initializes the ProcessingUnit to the empty state.

Method Summary

Modifier and TypeMethod and Description
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()

Gets the CompilerConfiguration for this ProcessingUnit.

public ErrorCollector
getErrorCollector()

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

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 given phase.

public boolean
public void
nextPhase()

A synonym for gotoPhase(getPhase() + 1).

public void
setClassLoader(final GroovyClassLoader loader)

Sets the class loader for use by this ProcessingUnit.

public final void
setConfiguration(CompilerConfiguration configuration)

Sets the CompilerConfiguration for this ProcessingUnit.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

classLoaderback to summary
protected GroovyClassLoader classLoader

The ClassLoader to use during processing

configurationback to summary
protected CompilerConfiguration configuration

Configuration and other settings that control processing

errorCollectorback to summary
protected ErrorCollector errorCollector

a helper to share errors and report them

phaseback to summary
protected int phase

The current phase

phaseCompleteback to summary
protected boolean phaseComplete

True if phase is finished

Constructor Detail

ProcessingUnitback to summary
public ProcessingUnit(final CompilerConfiguration configuration, final GroovyClassLoader classLoader, final ErrorCollector errorCollector)

Initializes the ProcessingUnit to the empty state.

Method Detail

completePhaseback to summary
public void completePhase() throws CompilationFailedException

Marks the current phase complete and processes any errors.

configureback to summary
public void configure(CompilerConfiguration configuration)

Reconfigures the ProcessingUnit.

getClassLoaderback to summary
public GroovyClassLoader getClassLoader()

Returns the class loader in use by this ProcessingUnit.

getConfigurationback to summary
public CompilerConfiguration getConfiguration()

Gets the CompilerConfiguration for this ProcessingUnit.

getErrorCollectorback to summary
public ErrorCollector getErrorCollector()

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

getPhaseback to summary
public int getPhase()

Returns the current phase.

getPhaseDescriptionback to summary
public String getPhaseDescription()

Returns the description for the current phase.

gotoPhaseback to summary
public void gotoPhase(int phase) throws CompilationFailedException

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

isPhaseCompleteback to summary
public boolean isPhaseComplete()
nextPhaseback to summary
public void nextPhase() throws CompilationFailedException

A synonym for gotoPhase(getPhase() + 1).

setClassLoaderback to summary
public void setClassLoader(final GroovyClassLoader loader)

Sets the class loader for use by this ProcessingUnit.

setConfigurationback to summary
public final void setConfiguration(CompilerConfiguration configuration)

Sets the CompilerConfiguration for this ProcessingUnit.