public class CompileUnit extends Object
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.
Constructor and Description |
---|
CompileUnit(GroovyClassLoader classLoader,
CodeSource codeSource,
CompilerConfiguration config) |
CompileUnit(GroovyClassLoader classLoader,
CompilerConfiguration config) |
Modifier and Type | Method and Description |
---|---|
void |
addClass(ClassNode node)
Adds a class to the unit.
|
void |
addClassNodeToCompile(ClassNode node,
SourceUnit location)
this method actually does not compile a class.
|
void |
addGeneratedInnerClass(InnerClassNode icn) |
void |
addModule(ModuleNode node) |
ClassNode |
getClass(String name) |
List |
getClasses() |
GroovyClassLoader |
getClassLoader() |
CodeSource |
getCodeSource() |
CompilerConfiguration |
getConfig() |
InnerClassNode |
getGeneratedInnerClass(String name) |
List<ModuleNode> |
getModules() |
SourceUnit |
getScriptSourceLocation(String className) |
boolean |
hasClassNodeToCompile() |
Iterator<String> |
iterateClassNodeToCompile() |
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 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)