public abstract class BaseImportsFormatter extends Object implements ImportsFormatter
Constructor and Description |
---|
BaseImportsFormatter() |
Modifier and Type | Method and Description |
---|---|
protected abstract ImportPackage |
createImportPackage(String line) |
protected ImportPackage |
createJavaImportPackage(String line) |
protected abstract String |
doFormat(String content,
Pattern importPattern,
String packagePath,
String className) |
String |
format(String content,
Pattern importPattern) |
String |
format(String content,
String packagePath,
String className) |
protected String |
sortAndGroupImports(String imports) |
protected String |
stripUnusedImports(String imports,
String content,
String packagePath,
String className,
String classNameExceptionRegex) |
public String format(String content, Pattern importPattern) throws IOException
format
in interface ImportsFormatter
IOException
public String format(String content, String packagePath, String className) throws IOException
format
in interface ImportsFormatter
IOException
protected abstract ImportPackage createImportPackage(String line)
protected ImportPackage createJavaImportPackage(String line)
protected abstract String doFormat(String content, Pattern importPattern, String packagePath, String className) throws IOException
IOException
protected String sortAndGroupImports(String imports) throws IOException
IOException
protected String stripUnusedImports(String imports, String content, String packagePath, String className, String classNameExceptionRegex) throws IOException
IOException