addImport
adds an import if not implicitly imported by java (i.e. java.lang) or added before. Asterisk imports overrule the other imports within the same package.
Return
this
Parameters
Add an import to the list of ImportDeclaration of this compilation unit shorthand for addImport with name,false,false,false
Return
this, the CompilationUnit
Parameters
the import name
Add an import to the list of ImportDeclaration of this compilation unit shorthand for addImport with clazz.getName()
Return
this, the CompilationUnit
Parameters
the class to import
Throws
if clazz is an anonymous or local class
Add a non-module import to the list of ImportDeclaration of this compilation unitThis method check if no import with the same name is already in the list
Return
this, the CompilationUnit
Parameters
the import name
is it an "import static"
does the import end with ".*"
Add an import to the list of ImportDeclaration of this compilation unitThis method check if no import with the same name is already in the list
Return
this, the CompilationUnit
Parameters
the import name
is it an "import static"
does the import end with ".*"
is it an "import module"