- org.codehaus.groovy.ast.ModuleNode
-
- All Implemented Interfaces and Traits:
- org.objectweb.asm.Opcodes
public class ModuleNode
extends ASTNode
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-
-
Methods Summary
Methods
Type |
Name and description |
void |
addClass(ClassNode node)
|
void |
addImport(String alias, ClassNode type)
|
void |
addImport(String alias, ClassNode type, List<AnnotationNode> annotations)
|
void |
addMethod(MethodNode node)
|
void |
addStarImport(String packageName)
|
void |
addStarImport(String packageName, List<AnnotationNode> annotations)
|
void |
addStatement(Statement node)
|
void |
addStaticImport(ClassNode type, String fieldName, String alias)
|
void |
addStaticImport(ClassNode type, String fieldName, String alias, List<AnnotationNode> annotations)
|
void |
addStaticStarImport(String name, ClassNode type)
|
void |
addStaticStarImport(String name, ClassNode type, List<AnnotationNode> annotations)
|
protected ClassNode |
createStatementsClass()
|
protected String |
extractClassFromFileDescription()
|
List<ClassNode> |
getClasses()
|
SourceUnit |
getContext()
|
String |
getDescription() @return the underlying character stream description |
ImportNode |
getImport(String alias) @param alias the name of interest |
ClassNode |
getImportType(String alias) @param alias the name of interest |
List<ImportNode> |
getImports()
|
String |
getMainClassName()
|
List<MethodNode> |
getMethods()
|
PackageNode |
getPackage()
|
String |
getPackageName()
|
ClassNode |
getScriptClassDummy()
|
List<ImportNode> |
getStarImports()
|
BlockStatement |
getStatementBlock()
|
Map<String, ImportNode> |
getStaticImports()
|
Map<String, ImportNode> |
getStaticStarImports()
|
CompileUnit |
getUnit()
|
boolean |
hasImportsResolved()
|
boolean |
hasPackage()
|
boolean |
hasPackageName()
|
boolean |
isEmpty()
|
void |
setDescription(String description)
|
void |
setImportsResolved(boolean importsResolved)
|
void |
setPackage(PackageNode packageNode)
|
void |
setPackageName(String packageName)
|
void |
sortClasses()
|
void |
visit(GroovyCodeVisitor visitor)
|
-
Inherited Methods Summary
Inherited Methods
Methods inherited from class |
Name |
class ASTNode |
copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getNodeMetaData, getNodeMetaData, getText, putNodeMetaData, removeNodeMetaData, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setNodeMetaData, setSourcePosition, visit |
class Object |
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
-
-
Method Detail
-
public void addStarImport(String packageName)
-
protected String extractClassFromFileDescription()
-
public String getDescription()
- Returns:
- the underlying character stream description
-
- Parameters:
alias
- the name of interest
- Returns:
- the import node for the given alias or null if none is available
-
- Parameters:
alias
- the name of interest
- Returns:
- the class node for the given alias or null if none is available
-
public String getMainClassName()
-
public String getPackageName()
-
public boolean hasImportsResolved()
-
public boolean hasPackage()
-
public boolean hasPackageName()
-
public void setDescription(String description)
-
public void setImportsResolved(boolean importsResolved)
-
public void setPackageName(String packageName)
-
public void sortClasses()
Copyright © 2003-2015 The Apache Software Foundation. All rights reserved.