public class CompileUnit extends Object implements NodeMetaDataHandler
ModuleNode
instances. There's one instance of this that's shared by all modules and
classes compiled during a single invocation of the compiler.
It's attached to MethodNodes and ClassNodes and is used to find fully qualified names of classes, resolve imports, and that sort of thing.
Modifier and Type | Class and Description |
---|---|
static class |
CompileUnit.ConstructedOuterNestedClassNode
Represents a resolved type as a placeholder.
|
Constructor and Description |
---|
CompileUnit(GroovyClassLoader classLoader,
CodeSource codeSource,
CompilerConfiguration config) |
CompileUnit(GroovyClassLoader classLoader,
CompilerConfiguration config) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
copyNodeMetaData, getNodeMetaData, getNodeMetaData, getNodeMetaData, putNodeMetaData, removeNodeMetaData, setNodeMetaData
public CompileUnit(GroovyClassLoader classLoader, CompilerConfiguration config)
public CompileUnit(GroovyClassLoader classLoader, CodeSource codeSource, CompilerConfiguration config)
public List<ModuleNode> getModules()
public void addModule(ModuleNode node)
public ClassNode getClass(String name)
public List<ClassNode> getClasses()
public CompilerConfiguration getConfig()
public GroovyClassLoader getClassLoader()
public CodeSource getCodeSource()
public void addClass(ClassNode node)
public void addClassNodeToCompile(ClassNode node, SourceUnit location)
public SourceUnit getScriptSourceLocation(String className)
public boolean hasClassNodeToCompile()
public InnerClassNode getGeneratedInnerClass(String name)
public void addGeneratedInnerClass(InnerClassNode icn)
public Map<String,InnerClassNode> getGeneratedInnerClasses()
public Map<String,CompileUnit.ConstructedOuterNestedClassNode> getClassesToResolve()
public void addClassNodeToResolve(CompileUnit.ConstructedOuterNestedClassNode cn)
cn
- the constructed class nodepublic Map<?,?> getMetaDataMap()
getMetaDataMap
in interface NodeMetaDataHandler
public void setMetaDataMap(Map<?,?> metaDataMap)
setMetaDataMap
in interface NodeMetaDataHandler