public class CompileUnit extends Object implements NodeMetaDataHandler
Represents the entire contents of a compilation step which consists of one or more 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, CompilerConfiguration config) |
CompileUnit(GroovyClassLoader classLoader, CodeSource codeSource, CompilerConfiguration config) |
Type Params | Return Type | Name and description |
---|---|---|
|
public void |
addClass(ClassNode node) Adds a class to the unit. |
|
public void |
addClassNodeToCompile(ClassNode node, SourceUnit location) this method actually does not compile a class. |
|
public void |
addClasses(List<ClassNode> list) Appends all of the fully-qualified class names in this module into the given map. |
|
public void |
addGeneratedInnerClass(InnerClassNode icn) |
|
public void |
addModule(ModuleNode node) |
|
public ClassNode |
getClass(String name)
|
|
public GroovyClassLoader |
getClassLoader() |
|
public List<ClassNode> |
getClasses()
|
|
public Map<String, ClassNode> |
getClassesToCompile() |
|
public CodeSource |
getCodeSource() |
|
public CompilerConfiguration |
getConfig() |
|
public InnerClassNode |
getGeneratedInnerClass(String name) |
|
public Map<String, InnerClassNode> |
getGeneratedInnerClasses() |
|
public Map<?, ?> |
getMetaDataMap() |
|
public List<ModuleNode> |
getModules() |
|
public SourceUnit |
getScriptSourceLocation(String className) |
|
public boolean |
hasClassNodeToCompile() |
|
public Iterator<String> |
iterateClassNodeToCompile() |
|
public void |
setMetaDataMap(Map<?, ?> metaDataMap) |
Adds a class to the unit.
this method actually does not compile a class. It's only a marker that this type has to be compiled by the CompilationUnit at the end of a parse step no node should be left.
Appends all of the fully-qualified class names in this module into the given map.
Copyright © 2003-2022 The Apache Software Foundation. All rights reserved.