public class CompileUnit
extends java.lang.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,
java.security.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(java.lang.String name) |
java.util.List |
getClasses() |
GroovyClassLoader |
getClassLoader() |
java.security.CodeSource |
getCodeSource() |
CompilerConfiguration |
getConfig() |
InnerClassNode |
getGeneratedInnerClass(java.lang.String name) |
java.util.List<ModuleNode> |
getModules() |
SourceUnit |
getScriptSourceLocation(java.lang.String className) |
boolean |
hasClassNodeToCompile() |
java.util.Iterator<java.lang.String> |
iterateClassNodeToCompile() |
public CompileUnit(GroovyClassLoader classLoader, CompilerConfiguration config)
public CompileUnit(GroovyClassLoader classLoader, java.security.CodeSource codeSource, CompilerConfiguration config)
public java.util.List<ModuleNode> getModules()
public void addModule(ModuleNode node)
public ClassNode getClass(java.lang.String name)
public java.util.List getClasses()
public CompilerConfiguration getConfig()
public GroovyClassLoader getClassLoader()
public java.security.CodeSource getCodeSource()
public void addClass(ClassNode node)
public void addClassNodeToCompile(ClassNode node, SourceUnit location)
public SourceUnit getScriptSourceLocation(java.lang.String className)
public boolean hasClassNodeToCompile()
public java.util.Iterator<java.lang.String> iterateClassNodeToCompile()
public InnerClassNode getGeneratedInnerClass(java.lang.String name)
public void addGeneratedInnerClass(InnerClassNode icn)