|
Groovy 2.2.0 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.codehaus.groovy.ast.ASTNode org.codehaus.groovy.ast.ModuleNode
public class ModuleNode extends ASTNode
Represents a module, which consists typically of a class declaration but could include some imports, some statements and multiple classes intermixed with statements like scripts in Python or Ruby
Constructor Summary | |
ModuleNode(SourceUnit context)
|
|
ModuleNode(CompileUnit unit)
|
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Constructor Detail |
---|
public ModuleNode(SourceUnit context)
public ModuleNode(CompileUnit unit)
Method Detail |
---|
public void addClass(ClassNode node)
public void addImport(String alias, ClassNode type)
public void addImport(String alias, ClassNode type, List annotations)
public void addMethod(MethodNode node)
public void addStarImport(String packageName)
public void addStarImport(String packageName, List annotations)
public void addStatement(Statement node)
public void addStaticImport(ClassNode type, String fieldName, String alias)
public void addStaticImport(ClassNode type, String fieldName, String alias, List annotations)
public void addStaticStarImport(String name, ClassNode type)
public void addStaticStarImport(String name, ClassNode type, List annotations)
protected ClassNode createStatementsClass()
protected String extractClassFromFileDescription()
public List getClasses()
public SourceUnit getContext()
public String getDescription()
public ImportNode getImport(String alias)
alias
- the name of interest
public ClassNode getImportType(String alias)
alias
- the name of interest
public List getImports()
public String getMainClassName()
public List getMethods()
public PackageNode getPackage()
public String getPackageName()
public ClassNode getScriptClassDummy()
public List getStarImports()
public BlockStatement getStatementBlock()
public Map getStaticImports()
public Map getStaticStarImports()
public CompileUnit getUnit()
public boolean hasImportsResolved()
public boolean hasPackage()
public boolean hasPackageName()
public boolean isEmpty()
public void setDescription(String description)
public void setImportsResolved(boolean importsResolved)
public void setPackage(PackageNode packageNode)
public void setPackageName(String packageName)
public void sortClasses()
public void visit(GroovyCodeVisitor visitor)
Copyright © 2003-2013 The Codehaus. All rights reserved.