Package: org.codehaus.groovy.ast

## [Java] Class ImportNode

- org.codehaus.groovy.ast.ImportNode

- Represents an import statement.

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `ClassNode` | `type`

  - ### Constructor Summary

    Constructors
    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`

  - ### Methods Summary

    Methods
    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)`

  - ### Inherited Methods Summary

    Inherited Methods
    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`

- - ### Property Detail

    - #### ClassNode type

  - ### Constructor Detail

    - #### public ImportNode(ClassNode type, String alias)

      An import of a single type, i.e. `import pack.Type` or `import pack.Type as Alias`

      Parameters:
        `type` - the type reference
        `alias` - optional alias

    - #### public ImportNode(String packageName)

      An import of all types in a package, i.e. `import pack.*`

      Parameters:
        `packageName` - the name of the package

    - #### public ImportNode(ClassNode type)

      An import of all static members of a type, i.e. `import static pack.Type.*`

      Parameters:
        `type` - the type reference

    - #### public 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`

      Parameters:
        `type` - the type reference
        `fieldName` - the field name
        `alias` - optional alias

  - ### Method Detail

    - #### public String getAlias()

    - #### public String getClassName()

    - #### public String getFieldName()

    - #### public String getPackageName()

    - #### @Override public String getText()

      Returns:
        the text display of this import

    - #### public ClassNode getType()

    - #### public boolean isStar()

    - #### public boolean isStatic()

    - #### public void setType(ClassNode type)

    - #### @Override public void visit(GroovyCodeVisitor visitor)