|
Groovy 2.2.0 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.codehaus.groovy.control.ProcessingUnit org.codehaus.groovy.control.CompilationUnit
public class CompilationUnit extends ProcessingUnit
The CompilationUnit collects all compilation data as it is generated by the compiler system. You can use this object to add additional source units to the compilation, or force the compilation to be run again (to affect only the deltas).
You can also add PhaseOperations to this compilation using the addPhaseOperation method. This is commonly used when you want to wire a new AST Transformation into the compilation.
Nested Class Summary | |
---|---|
static class |
CompilationUnit.ClassgenCallback
Sets a ClassgenCallback. |
static class |
CompilationUnit.GroovyClassOperation
|
static class |
CompilationUnit.PrimaryClassNodeOperation
|
static class |
CompilationUnit.ProgressCallback
|
static class |
CompilationUnit.SourceUnitOperation
|
Field Summary | |
---|---|
protected CompileUnit |
ast
|
protected ASTTransformationsContext |
astTransformationsContext
|
protected ClassNodeResolver |
classNodeResolver
|
protected Map |
classSourcesByPublicClassName
|
protected CompilationUnit.ClassgenCallback |
classgenCallback
Initializes the CompilationUnit with defaults. |
protected boolean |
configured
|
protected boolean |
debug
|
protected List |
generatedClasses
|
protected List |
names
|
protected OptimizerVisitor |
optimizer
|
protected CompilationUnit.ProgressCallback |
progressCallback
|
protected LinkedList |
queuedSources
|
protected ResolveVisitor |
resolveVisitor
|
protected Map |
sources
|
protected StaticImportVisitor |
staticImportVisitor
|
protected Map |
summariesByPublicClassName
|
protected Map |
summariesBySourceName
|
protected Verifier |
verifier
|
Fields inherited from class ProcessingUnit | |
---|---|
classLoader, configuration, errorCollector, phase, phaseComplete |
Constructor Summary | |
CompilationUnit()
|
|
CompilationUnit(GroovyClassLoader loader)
|
|
CompilationUnit(CompilerConfiguration configuration)
|
|
CompilationUnit(CompilerConfiguration configuration, CodeSource security, GroovyClassLoader loader)
|
|
CompilationUnit(CompilerConfiguration configuration, CodeSource security, GroovyClassLoader loader, GroovyClassLoader transformLoader)
|
Methods inherited from class ProcessingUnit | |
---|---|
completePhase, configure, getClassLoader, getConfiguration, getErrorCollector, getPhase, getPhaseDescription, gotoPhase, nextPhase, setClassLoader, setConfiguration |
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Field Detail |
---|
protected CompileUnit ast
protected ASTTransformationsContext astTransformationsContext
protected ClassNodeResolver classNodeResolver
protected Map classSourcesByPublicClassName
protected CompilationUnit.ClassgenCallback classgenCallback
protected boolean configured
protected boolean debug
protected List generatedClasses
protected List names
protected OptimizerVisitor optimizer
protected CompilationUnit.ProgressCallback progressCallback
protected LinkedList queuedSources
protected ResolveVisitor resolveVisitor
protected Map sources
protected StaticImportVisitor staticImportVisitor
protected Map summariesByPublicClassName
protected Map summariesBySourceName
protected Verifier verifier
Constructor Detail |
---|
public CompilationUnit()
public CompilationUnit(GroovyClassLoader loader)
public CompilationUnit(CompilerConfiguration configuration)
public CompilationUnit(CompilerConfiguration configuration, CodeSource security, GroovyClassLoader loader)
public CompilationUnit(CompilerConfiguration configuration, CodeSource security, GroovyClassLoader loader, GroovyClassLoader transformLoader)
Method Detail |
---|
public void addClassNode(ClassNode node)
public void addNewPhaseOperation(CompilationUnit.SourceUnitOperation op, int phase)
public void addPhaseOperation(CompilationUnit.SourceUnitOperation op, int phase)
public void addPhaseOperation(CompilationUnit.PrimaryClassNodeOperation op, int phase)
public void addPhaseOperation(CompilationUnit.GroovyClassOperation op)
public SourceUnit addSource(File file)
public SourceUnit addSource(URL url)
public SourceUnit addSource(String name, InputStream stream)
public SourceUnit addSource(String name, String scriptText)
public SourceUnit addSource(SourceUnit source)
public void addSources(String[] paths)
public void addSources(File[] files)
public void applyToGeneratedGroovyClasses(CompilationUnit.GroovyClassOperation body)
public void applyToPrimaryClassNodes(CompilationUnit.PrimaryClassNodeOperation body)
public void applyToSourceUnits(CompilationUnit.SourceUnitOperation body)
public void compile()
public void compile(int throughPhase)
public void configure(CompilerConfiguration configuration)
protected org.objectweb.asm.ClassVisitor createClassVisitor()
protected boolean dequeued()
public CompileUnit getAST()
public ASTTransformationsContext getASTTransformationsContext()
public ClassNode getClassNode(String name)
public ClassNodeResolver getClassNodeResolver()
public Map getClassSourcesByPublicClassName()
public List getClasses()
public CompilationUnit.ClassgenCallback getClassgenCallback()
public ClassNode getFirstClassNode()
public CompilationUnit.ProgressCallback getProgressCallback()
public Map getSummariesByPublicClassName()
public Map getSummariesBySourceName()
public GroovyClassLoader getTransformLoader()
public boolean isPublicClass(String className)
public Iterator iterator()
protected void mark()
public void setClassNodeResolver(ClassNodeResolver classNodeResolver)
public void setClassgenCallback(CompilationUnit.ClassgenCallback visitor)
public void setProgressCallback(CompilationUnit.ProgressCallback callback)
Copyright © 2003-2013 The Codehaus. All rights reserved.