Package: org.codehaus.groovy.control.customizers

## [Java] Class ImportCustomizer

- org.codehaus.groovy.control.customizers.ImportCustomizer

- This compilation customizer allows addiing various types of imports to the compilation unit. Supports adding :

  - standard imports thanks to addImport(String), addImport(String, String) or addImports(String...)
  - star imports thanks to addStarImport(String) or addStarImports(String...)
  - static imports thanks to addStaticImport(String, String) or addStaticImport(String, String, String)
  - static star imports thanks to addStaticStar(String) or addStaticStars(String...)
  Authors:
    Cedric Champeau
  Since:
    1.8.0

- - ### Constructor Summary

    Constructors
    Constructor and description
    `ImportCustomizer ()`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `ImportCustomizer` | `addImport(String alias, String className)`
    `` | `ImportCustomizer` | `addImports(String... imports)`
    `` | `ImportCustomizer` | `addStarImports(String... packageNames)`
    `` | `ImportCustomizer` | `addStaticImport(String className, String fieldName)`
    `` | `ImportCustomizer` | `addStaticImport(String alias, String className, String fieldName)`
    `` | `ImportCustomizer` | `addStaticStars(String... classNames)`
    `` | `void` | `call(org.codehaus.groovy.control.SourceUnit source, GeneratorContext context, ClassNode classNode)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class CompilationCustomizer` | `getPhase`
    `class org.codehaus.groovy.control.CompilationUnit$PrimaryClassNodeOperation` | `org.codehaus.groovy.control.CompilationUnit$PrimaryClassNodeOperation#call(org.codehaus.groovy.control.SourceUnit, org.codehaus.groovy.classgen.GeneratorContext, org.codehaus.groovy.ast.ClassNode), org.codehaus.groovy.control.CompilationUnit$PrimaryClassNodeOperation#needSortedInput(), org.codehaus.groovy.control.CompilationUnit$PrimaryClassNodeOperation#wait(), org.codehaus.groovy.control.CompilationUnit$PrimaryClassNodeOperation#wait(long, int), org.codehaus.groovy.control.CompilationUnit$PrimaryClassNodeOperation#wait(long), org.codehaus.groovy.control.CompilationUnit$PrimaryClassNodeOperation#equals(java.lang.Object), org.codehaus.groovy.control.CompilationUnit$PrimaryClassNodeOperation#toString(), org.codehaus.groovy.control.CompilationUnit$PrimaryClassNodeOperation#hashCode(), org.codehaus.groovy.control.CompilationUnit$PrimaryClassNodeOperation#getClass(), org.codehaus.groovy.control.CompilationUnit$PrimaryClassNodeOperation#notify(), org.codehaus.groovy.control.CompilationUnit$PrimaryClassNodeOperation#notifyAll()`

- - ### Constructor Detail

    - #### public ImportCustomizer()

  - ### Method Detail

    - #### public ImportCustomizer addImport(String alias, String className)

    - #### public ImportCustomizer addImports(String... imports)

    - #### public ImportCustomizer addStarImports(String... packageNames)

    - #### public ImportCustomizer addStaticImport(String className, String fieldName)

    - #### public ImportCustomizer addStaticImport(String alias, String className, String fieldName)

    - #### public ImportCustomizer addStaticStars(String... classNames)

    - #### @Override public void call(org.codehaus.groovy.control.SourceUnit source, GeneratorContext context, ClassNode classNode)