Groovy 2.2.1

org.codehaus.groovy.ast
[Java] 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

public class ImportNode
extends AnnotatedNode

Represents an import statement of a single class

Authors:
Jochen Theodorou
Paul King
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()

@return the text display of this import

ClassNode getType()

boolean isStar()

boolean isStatic()

void visit(GroovyCodeVisitor visitor)

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

Constructor Detail

ImportNode

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


ImportNode

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


ImportNode

public ImportNode(ClassNode type)
Represent a static import of a Class, i.e. import static package.Classname.*
Parameters:
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
Parameters:
type - the referenced class
fieldName - the field name
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()
Returns:
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-2013 The Codehaus. All rights reserved.