com.liferay.portal.tools
Class BaseImportsFormatter
java.lang.Object
com.liferay.portal.tools.BaseImportsFormatter
- All Implemented Interfaces:
- ImportsFormatter
- Direct Known Subclasses:
- JavaImportsFormatter
public abstract class BaseImportsFormatter
- extends Object
- implements ImportsFormatter
|
Method Summary |
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)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BaseImportsFormatter
public BaseImportsFormatter()
format
public String format(String content,
Pattern importPattern)
throws IOException
- Specified by:
format in interface ImportsFormatter
- Throws:
IOException
format
public String format(String content,
String packagePath,
String className)
throws IOException
- Specified by:
format in interface ImportsFormatter
- Throws:
IOException
createImportPackage
protected abstract ImportPackage createImportPackage(String line)
createJavaImportPackage
protected ImportPackage createJavaImportPackage(String line)
doFormat
protected abstract String doFormat(String content,
Pattern importPattern,
String packagePath,
String className)
throws IOException
- Throws:
IOException
sortAndGroupImports
protected String sortAndGroupImports(String imports)
throws IOException
- Throws:
IOException
stripUnusedImports
protected String stripUnusedImports(String imports,
String content,
String packagePath,
String className,
String classNameExceptionRegex)
throws IOException
- Throws:
IOException