Represents an import statement.
Constructor and description |
---|
ImportNode
(ClassNode type, String alias) An import of a single type, i.e. import pack.Type or import pack.Type as Alias |
ImportNode
(String packageName) An import of all types in a package, i.e. import pack.* |
ImportNode
(ClassNode type) An import of all static members of a type, i.e. import static pack.Type.* |
ImportNode
(ClassNode type, String fieldName, String alias) An import of a static field or method of a type, i.e. import static pack.Type.name or import static pack.Type.name as alias |
Type Params | Return Type | Name and description |
---|---|---|
|
String |
getAlias() |
|
String |
getClassName() |
|
String |
getFieldName() |
|
String |
getPackageName() |
|
String |
getText() @return the text display of this import |
|
ClassNode |
getType() |
|
boolean |
isStar() |
|
boolean |
isStatic() |
|
void |
setType(ClassNode type) |
|
void |
visit(GroovyCodeVisitor visitor) |
Methods inherited from class | Name |
---|---|
class AnnotatedNode |
addAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, hasNoRealSourcePosition, isSynthetic, setDeclaringClass, setHasNoRealSourcePosition, setSynthetic |
class ASTNode |
copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getNodeMetaData, getNodeMetaData, getText, putNodeMetaData, removeNodeMetaData, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setNodeMetaData, setSourcePosition, visit |
An import of a single type, i.e. import pack.Type
or import pack.Type as Alias
type
- the type referencealias
- optional alias An import of all types in a package, i.e. import pack.*
packageName
- the name of the package An import of all static members of a type, i.e. import static pack.Type.*
type
- the type referenceCopyright © 2003-2021 The Apache Software Foundation. All rights reserved.