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:
- standard imports via
addImports(String...)
oraddImport(String, String)
- star imports via
addStarImports(String...)
- static imports via
addStaticImport(String, String)
oraddStaticImport(String, String, String)
- static star imports via
addStaticStars(String...)
- Since:
- 1.8.0
-
Constructor Summary
Constructors Constructor Description ImportCustomizer()
-
Method Summary
Modifier and Type Method Description ImportCustomizer
addImport(java.lang.String alias, java.lang.String className)
ImportCustomizer
addImports(java.lang.String... classNames)
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 org.codehaus.groovy.control.customizers.CompilationCustomizer
getPhase
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.codehaus.groovy.control.CompilationUnit.IPrimaryClassNodeOperation
doPhaseOperation, needSortedInput
-
Constructor Details
-
ImportCustomizer
public ImportCustomizer()
-
-
Method Details
-
call
-
addImport
-
addStaticImport
-
addStaticImport
public ImportCustomizer addStaticImport(java.lang.String alias, java.lang.String className, java.lang.String fieldName) -
addImports
-
addStarImports
-
addStaticStars
-