Liferay 7.0-ga1 portal-impl

com.liferay.portal.tools
Class BaseImportsFormatter

java.lang.Object
  extended by com.liferay.portal.tools.BaseImportsFormatter
All Implemented Interfaces:
ImportsFormatter
Direct Known Subclasses:
JavaImportsFormatter

public abstract class BaseImportsFormatter
extends Object
implements ImportsFormatter


Constructor Summary
BaseImportsFormatter()
           
 
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
 

Constructor Detail

BaseImportsFormatter

public BaseImportsFormatter()
Method Detail

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

Liferay 7.0-ga1 portal-impl