public abstract class BaseSourceProcessor extends java.lang.Object implements SourceProcessor
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
BASEDIR |
protected static FileImpl |
fileUtil |
protected static java.util.regex.Pattern |
languageKeyPattern |
protected static java.lang.String |
MAIN_RELEASE_VERSION_6_1_0 |
protected static java.lang.String |
MAIN_RELEASE_VERSION_6_2_0 |
protected static java.lang.String |
mainReleaseVersion |
protected static boolean |
portalSource |
protected static SAXReaderImpl |
saxReaderUtil |
protected static java.util.regex.Pattern |
sessionKeyPattern |
protected static SourceFormatterHelper |
sourceFormatterHelper |
protected static java.util.regex.Pattern |
taglibSessionKeyPattern |
| Constructor and Description |
|---|
BaseSourceProcessor() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkIfClauseParentheses(java.lang.String ifClause,
java.lang.String fileName,
int lineCount) |
protected void |
checkInefficientStringMethods(java.lang.String line,
java.lang.String fileName,
int lineCount) |
protected void |
checkLanguageKeys(java.lang.String fileName,
java.lang.String content,
java.util.regex.Pattern pattern) |
protected void |
checkStringBundler(java.lang.String line,
java.lang.String fileName,
int lineCount) |
protected java.lang.String |
fixCompatClassImports(java.io.File file,
java.lang.String content) |
protected java.lang.String |
fixCopyright(java.lang.String content,
java.lang.String copyright,
java.lang.String oldCopyright,
java.io.File file,
java.lang.String fileName) |
protected java.lang.String |
fixSessionKey(java.lang.String fileName,
java.lang.String content,
java.util.regex.Pattern pattern) |
protected abstract void |
format() |
void |
format(boolean useProperties,
boolean printErrors,
boolean autoFix,
java.lang.String mainReleaseVersion) |
protected java.lang.String |
format(java.lang.String fileName) |
java.lang.String |
format(java.lang.String fileName,
boolean useProperties,
boolean printErrors,
boolean autoFix,
java.lang.String mainReleaseVersion) |
protected static java.lang.String |
formatImports(java.lang.String imports,
int classStartPos) |
protected java.util.Map<java.lang.String,java.lang.String> |
getCompatClassNamesMap() |
protected java.lang.String |
getCopyright() |
protected java.lang.String |
getCustomCopyright(java.io.File file) |
java.util.List<java.lang.String> |
getErrorMessages() |
protected java.util.Properties |
getExclusionsProperties(java.lang.String fileName) |
protected java.util.List<java.lang.String> |
getFileNames(java.lang.String[] excludes,
java.lang.String[] includes) |
protected java.util.List<java.lang.String> |
getFileNames(java.lang.String basedir,
java.lang.String[] excludes,
java.lang.String[] includes) |
protected java.lang.String[] |
getLanguageKeys(java.util.regex.Matcher matcher) |
protected java.lang.String |
getOldCopyright() |
protected boolean |
hasMissingParentheses(java.lang.String s) |
protected boolean |
hasRedundantParentheses(java.lang.String s) |
protected boolean |
isAutoFix() |
protected void |
processErrorMessage(java.lang.String fileName,
java.lang.String message) |
protected java.lang.String |
replacePrimitiveWrapperInstantiation(java.lang.String fileName,
java.lang.String line,
int lineCount) |
protected java.lang.String |
stripQuotes(java.lang.String s,
char delimeter) |
protected java.lang.String |
stripRedundantParentheses(java.lang.String s) |
protected java.util.Properties |
stripTopLevelDirectories(java.util.Properties properties,
int level) |
protected java.lang.String |
trimContent(java.lang.String content,
boolean allowLeadingSpaces) |
protected java.lang.String |
trimLine(java.lang.String line,
boolean allowLeadingSpaces) |
protected static final java.lang.String BASEDIR
protected static final java.lang.String MAIN_RELEASE_VERSION_6_1_0
protected static final java.lang.String MAIN_RELEASE_VERSION_6_2_0
protected static FileImpl fileUtil
protected static java.util.regex.Pattern languageKeyPattern
protected static java.lang.String mainReleaseVersion
protected static boolean portalSource
protected static SAXReaderImpl saxReaderUtil
protected static java.util.regex.Pattern sessionKeyPattern
protected static SourceFormatterHelper sourceFormatterHelper
protected static java.util.regex.Pattern taglibSessionKeyPattern
public void format(boolean useProperties,
boolean printErrors,
boolean autoFix,
java.lang.String mainReleaseVersion)
throws java.lang.Exception
format in interface SourceProcessorjava.lang.Exceptionpublic java.lang.String format(java.lang.String fileName,
boolean useProperties,
boolean printErrors,
boolean autoFix,
java.lang.String mainReleaseVersion)
throws java.lang.Exception
format in interface SourceProcessorjava.lang.Exceptionpublic java.util.List<java.lang.String> getErrorMessages()
getErrorMessages in interface SourceProcessorprotected static java.lang.String formatImports(java.lang.String imports,
int classStartPos)
throws java.io.IOException
java.io.IOExceptionprotected void checkIfClauseParentheses(java.lang.String ifClause,
java.lang.String fileName,
int lineCount)
protected void checkInefficientStringMethods(java.lang.String line,
java.lang.String fileName,
int lineCount)
protected void checkLanguageKeys(java.lang.String fileName,
java.lang.String content,
java.util.regex.Pattern pattern)
throws java.io.IOException
java.io.IOExceptionprotected void checkStringBundler(java.lang.String line,
java.lang.String fileName,
int lineCount)
protected java.lang.String fixCompatClassImports(java.io.File file,
java.lang.String content)
throws java.io.IOException
java.io.IOExceptionprotected java.lang.String fixCopyright(java.lang.String content,
java.lang.String copyright,
java.lang.String oldCopyright,
java.io.File file,
java.lang.String fileName)
throws java.io.IOException
java.io.IOExceptionprotected java.lang.String fixSessionKey(java.lang.String fileName,
java.lang.String content,
java.util.regex.Pattern pattern)
protected abstract void format()
throws java.lang.Exception
java.lang.Exceptionprotected java.lang.String format(java.lang.String fileName)
throws java.lang.Exception
java.lang.Exceptionprotected java.util.Map<java.lang.String,java.lang.String> getCompatClassNamesMap()
throws java.io.IOException
java.io.IOExceptionprotected java.lang.String getCopyright()
throws java.io.IOException
java.io.IOExceptionprotected java.lang.String getCustomCopyright(java.io.File file)
throws java.io.IOException
java.io.IOExceptionprotected java.util.Properties getExclusionsProperties(java.lang.String fileName)
throws java.io.IOException
java.io.IOExceptionprotected java.util.List<java.lang.String> getFileNames(java.lang.String basedir,
java.lang.String[] excludes,
java.lang.String[] includes)
protected java.util.List<java.lang.String> getFileNames(java.lang.String[] excludes,
java.lang.String[] includes)
protected java.lang.String[] getLanguageKeys(java.util.regex.Matcher matcher)
protected java.lang.String getOldCopyright()
throws java.io.IOException
java.io.IOExceptionprotected boolean hasMissingParentheses(java.lang.String s)
protected boolean hasRedundantParentheses(java.lang.String s)
protected boolean isAutoFix()
protected void processErrorMessage(java.lang.String fileName,
java.lang.String message)
protected java.lang.String replacePrimitiveWrapperInstantiation(java.lang.String fileName,
java.lang.String line,
int lineCount)
protected java.lang.String stripQuotes(java.lang.String s,
char delimeter)
protected java.lang.String stripRedundantParentheses(java.lang.String s)
protected java.util.Properties stripTopLevelDirectories(java.util.Properties properties,
int level)
throws java.io.IOException
java.io.IOExceptionprotected java.lang.String trimContent(java.lang.String content,
boolean allowLeadingSpaces)
throws java.io.IOException
java.io.IOExceptionprotected java.lang.String trimLine(java.lang.String line,
boolean allowLeadingSpaces)