Groovy Documentation

org.codehaus.groovy.control.customizers
[Java] Class ImportCustomizer

java.lang.Object
  org.codehaus.groovy.control.CompilationUnit.PrimaryClassNodeOperation
      org.codehaus.groovy.control.customizers.CompilationCustomizer
          org.codehaus.groovy.control.customizers.ImportCustomizer

public class ImportCustomizer
extends CompilationCustomizer

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

Authors:
Cedric Champeau
Since:
1.8.0


Constructor Summary
ImportCustomizer()

 
Method Summary
ImportCustomizer addImport(java.lang.String alias, java.lang.String className)

ImportCustomizer addImports(java.lang.String... imports)

ImportCustomizer addStarImports(java.lang.String... packageNames)

ImportCustomizer addStaticImport(java.lang.String className, java.lang.String fieldName)

ImportCustomizer addStaticImport(java.lang.String alias, java.lang.String className, java.lang.String fieldName)

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

void call(SourceUnit source, GeneratorContext context, ClassNode classNode)

 
Methods inherited from class CompilationCustomizer
getPhase
 

Constructor Detail

ImportCustomizer

public ImportCustomizer()


 
Method Detail

addImport

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


addImports

public ImportCustomizer addImports(java.lang.String... imports)


addStarImports

public ImportCustomizer addStarImports(java.lang.String... packageNames)


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)


addStaticStars

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


call

@Override
public void call(SourceUnit source, GeneratorContext context, ClassNode classNode)


 

Groovy Documentation