Groovy 1.7.0

org.codehaus.groovy.ast
Class ImportNode

java.lang.Object
  org.codehaus.groovy.ast.ASTNode
      org.codehaus.groovy.ast.AnnotatedNode
          org.codehaus.groovy.ast.ImportNode
All Implemented Interfaces:
org.objectweb.asm.Opcodes

class ImportNode
extends AnnotatedNode

Represents an import statement of a single class author Jochen Theodorou author Paul King

author:
James Strachan


Constructor Summary
ImportNode(ClassNode type, String alias)

Represent an import of an entire package, i.e. import package.Classname

ImportNode(String packageName)

Represent an import of an entire package, i.e. import package.*

ImportNode(ClassNode type)

Represent a static import of a Class, i.e. import static package.Classname.*

ImportNode(ClassNode type, String fieldName, String alias)

Represent a static import of a field or method, i.e. import static package.Classname.name

 
Method Summary
String getAlias()

String getClassName()

String getFieldName()

String getPackageName()

String getText()

ClassNode getType()

boolean isStar()

boolean isStatic()

void visit(GroovyCodeVisitor visitor)

 
Methods inherited from class AnnotatedNode
addAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, isSynthetic, setDeclaringClass, setSynthetic
 
Methods inherited from class ASTNode
getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getText, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setSourcePosition, visit
 
Methods inherited from class Object
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll
 

Constructor Detail

ImportNode

public ImportNode(ClassNode type, String alias)
Represent an import of an entire package, i.e. import package.Classname
param:
type the referenced class
param:
alias optional alias


ImportNode

public ImportNode(String packageName)
Represent an import of an entire package, i.e. import package.*
param:
packageName the name of the package


ImportNode

public ImportNode(ClassNode type)
Represent a static import of a Class, i.e. import static package.Classname.*
param:
type the referenced class


ImportNode

public ImportNode(ClassNode type, String fieldName, String alias)
Represent a static import of a field or method, i.e. import static package.Classname.name
param:
type the referenced class
param:
fieldName the field name
param:
alias optional alias


 
Method Detail

getAlias

public String getAlias()


getClassName

public String getClassName()


getFieldName

public String getFieldName()


getPackageName

public String getPackageName()


getText

public String getText()
return:
the text display of this import


getType

public ClassNode getType()


isStar

public boolean isStar()


isStatic

public boolean isStatic()


visit

public void visit(GroovyCodeVisitor visitor)


 

Copyright © 2003-2009 The Codehaus. All rights reserved.