Package io.ultreia.java4all.util
Class ImportManager
- java.lang.Object
-
- io.ultreia.java4all.util.ImportManager
-
public class ImportManager extends Object
Helper to produce imports list.Used for example in processors or generators.
Created by tchemit on 20/01/2018.
- Author:
- Tony Chemit - dev@tchemit.fr
-
-
Constructor Summary
Constructors Constructor Description ImportManager(String defaultPackage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringaddImport(Class<?> type)Register a type and return his simple nameStringaddImport(String type)Register a type and return his simple nameList<String>getImportsList()StringgetImportsSection(String eol)Generate the import section of a java file.
-
-
-
Constructor Detail
-
ImportManager
public ImportManager(String defaultPackage)
-
-
Method Detail
-
addImport
public String addImport(Class<?> type)
Register a type and return his simple name- Parameters:
type- type to register- Returns:
- the simple name of given type
-
addImport
public String addImport(String type)
Register a type and return his simple name- Parameters:
type- type to register- Returns:
- the simple name of given type
-
-