Package org.codehaus.groovy.control
Class ProcessingUnit
java.lang.Object
org.codehaus.groovy.control.ProcessingUnit
- Direct Known Subclasses:
- CompilationUnit,- SourceUnit
A base class for data structures that can collect messages and errors
 during processing.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected GroovyClassLoaderThe ClassLoader to use during processingprotected CompilerConfigurationConfiguration and other settings that control processingprotected ErrorCollectora helper to share errors and report themprotected intThe current phaseprotected booleanTrue if phase is finished
- 
Constructor SummaryConstructorsConstructorDescriptionProcessingUnit(CompilerConfiguration configuration, GroovyClassLoader classLoader, ErrorCollector errorCollector) Initializes the ProcessingUnit to the empty state.
- 
Method SummaryModifier and TypeMethodDescriptionvoidMarks the current phase complete and processes any errors.voidconfigure(CompilerConfiguration configuration) Reconfigures the ProcessingUnit.Returns the class loader in use by this ProcessingUnit.Gets the CompilerConfiguration for this ProcessingUnit.Errors found during the compilation should be reported through the ErrorCollector.intgetPhase()Returns the current phase.Returns the description for the current phase.voidgotoPhase(int phase) Wraps up any pending operations for the current phase and switches to the given phase.booleanvoidA synonym forgotoPhase(getPhase() + 1).voidsetClassLoader(GroovyClassLoader loader) Sets the class loader for use by this ProcessingUnit.final voidsetConfiguration(CompilerConfiguration configuration) Sets the CompilerConfiguration for this ProcessingUnit.
- 
Field Details- 
phaseprotected int phaseThe current phase
- 
phaseCompleteprotected boolean phaseCompleteTrue if phase is finished
- 
configurationConfiguration and other settings that control processing
- 
classLoaderThe ClassLoader to use during processing
- 
errorCollectora helper to share errors and report them
 
- 
- 
Constructor Details- 
ProcessingUnitpublic ProcessingUnit(CompilerConfiguration configuration, GroovyClassLoader classLoader, ErrorCollector errorCollector) Initializes the ProcessingUnit to the empty state.
 
- 
- 
Method Details- 
configureReconfigures the ProcessingUnit.
- 
getConfigurationGets the CompilerConfiguration for this ProcessingUnit.
- 
setConfigurationSets the CompilerConfiguration for this ProcessingUnit.
- 
getClassLoaderReturns the class loader in use by this ProcessingUnit.
- 
setClassLoaderSets the class loader for use by this ProcessingUnit.
- 
getErrorCollectorErrors found during the compilation should be reported through the ErrorCollector.
- 
getPhasepublic int getPhase()Returns the current phase.
- 
getPhaseDescriptionReturns the description for the current phase.
- 
isPhaseCompletepublic boolean isPhaseComplete()
- 
completePhaseMarks the current phase complete and processes any errors.- Throws:
- CompilationFailedException
 
- 
nextPhaseA synonym forgotoPhase(getPhase() + 1).- Throws:
- CompilationFailedException
 
- 
gotoPhaseWraps up any pending operations for the current phase and switches to the given phase.- Throws:
- CompilationFailedException
 
 
-