Class ImportCustomizer

java.lang.Object
org.codehaus.groovy.control.customizers.CompilationCustomizer
org.codehaus.groovy.control.customizers.ImportCustomizer
All Implemented Interfaces:
CompilationUnit.IPrimaryClassNodeOperation

public class ImportCustomizer
extends CompilationCustomizer
This compilation customizer allows addiing various types of imports to the compilation unit. Supports adding:
Since:
1.8.0
  • Constructor Details

    • ImportCustomizer

      public ImportCustomizer()
  • Method Details

    • call

      public void call​(SourceUnit source, GeneratorContext context, ClassNode classNode)
    • addImport

      public ImportCustomizer addImport​(java.lang.String alias, java.lang.String className)
    • addStaticImport

      public ImportCustomizer addStaticImport​(java.lang.String className, java.lang.String fieldName)
    • addStaticImport

      public ImportCustomizer addStaticImport​(java.lang.String alias, java.lang.String className, java.lang.String fieldName)
    • addImports

      public ImportCustomizer addImports​(java.lang.String... classNames)
    • addStarImports

      public ImportCustomizer addStarImports​(java.lang.String... packageNames)
    • addStaticStars

      public ImportCustomizer addStaticStars​(java.lang.String... classNames)