public abstract class BaseSourceProcessor extends java.lang.Object implements SourceProcessor
| Modifier and Type | Field and Description |
|---|---|
protected static java.util.regex.Pattern |
attributeNamePattern |
protected static java.util.regex.Pattern |
bndContentDirPattern |
protected static java.util.regex.Pattern |
emptyCollectionPattern |
protected static java.util.regex.Pattern |
javaSourceInsideJSPTagPattern |
protected static java.util.regex.Pattern |
languageKeyPattern |
static int |
PORTAL_MAX_DIR_LEVEL |
protected static boolean |
portalSource |
protected static java.util.regex.Pattern |
principalExceptionPattern |
protected static java.util.regex.Pattern |
sessionKeyPattern |
protected SourceFormatterArgs |
sourceFormatterArgs |
protected static java.util.regex.Pattern |
taglibSessionKeyPattern |
| Constructor and Description |
|---|
BaseSourceProcessor() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkEmptyCollection(java.lang.String line,
java.lang.String fileName,
int lineCount) |
protected void |
checkIfClauseParentheses(java.lang.String ifClause,
java.lang.String fileName,
int lineCount) |
protected void |
checkInefficientStringMethods(java.lang.String line,
java.lang.String fileName,
java.lang.String absolutePath,
int lineCount) |
protected void |
checkLanguageKeys(java.lang.String fileName,
java.lang.String content,
java.util.regex.Pattern pattern) |
protected java.lang.String |
checkPrincipalException(java.lang.String content) |
protected void |
checkResourceUtil(java.lang.String line,
java.lang.String fileName,
int lineCount) |
protected void |
checkStringBundler(java.lang.String line,
java.lang.String fileName,
int lineCount) |
protected abstract java.lang.String |
doFormat(java.io.File file,
java.lang.String fileName,
java.lang.String absolutePath,
java.lang.String content) |
protected abstract java.util.List<java.lang.String> |
doGetFileNames() |
protected java.lang.String |
fixCompatClassImports(java.lang.String absolutePath,
java.lang.String content) |
protected java.lang.String |
fixCopyright(java.lang.String content,
java.lang.String absolutePath,
java.lang.String fileName) |
protected java.lang.String |
fixIncorrectParameterTypeForLanguageUtil(java.lang.String content,
boolean autoFix,
java.lang.String fileName) |
protected java.lang.String |
fixSessionKey(java.lang.String fileName,
java.lang.String content,
java.util.regex.Pattern pattern) |
void |
format() |
protected java.lang.String |
format(java.io.File file,
java.lang.String fileName,
java.lang.String absolutePath,
java.lang.String content) |
protected void |
format(java.lang.String fileName) |
protected java.lang.String |
formatIncorrectSyntax(java.lang.String line,
java.lang.String incorrectSyntax,
java.lang.String correctSyntax,
boolean lineStart) |
protected java.lang.String |
formatJavaTerms(java.lang.String javaClassName,
java.lang.String packagePath,
java.io.File file,
java.lang.String fileName,
java.lang.String absolutePath,
java.lang.String content,
java.lang.String javaClassContent,
int javaClassLineCount,
java.util.List<java.lang.String> checkJavaFieldTypesExclusionFiles,
java.util.List<java.lang.String> javaTermAccessLevelModifierExclusionFiles,
java.util.List<java.lang.String> javaTermSortExclusionFiles,
java.util.List<java.lang.String> testAnnotationsExclusionFiles) |
protected java.lang.String |
formatTagAttributeType(java.lang.String line,
java.lang.String tag,
java.lang.String attributeAndValue) |
protected java.lang.String |
formatWhitespace(java.lang.String line,
java.lang.String linePart) |
protected java.lang.String |
formatWhitespace(java.lang.String line,
java.lang.String trimmedLine,
boolean javaSource) |
protected java.lang.String |
getAbsolutePath(java.io.File file) |
protected java.util.Set<java.lang.String> |
getAnnotationsExclusions() |
protected java.util.Properties |
getBNDFileLanguageProperties(java.lang.String fileName) |
protected java.util.Map<java.lang.String,java.lang.String> |
getCompatClassNamesMap() |
protected java.lang.String |
getContent(java.lang.String fileName,
int level) |
protected java.lang.String |
getCustomCopyright(java.lang.String absolutePath) |
java.util.List<java.lang.String> |
getErrorMessages() |
protected java.io.File |
getFile(java.lang.String fileName,
int level) |
java.util.List<java.lang.String> |
getFileNames() |
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.util.List<java.lang.String> recentChangesFileNames,
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) |
SourceMismatchException |
getFirstSourceMismatchException() |
protected java.util.Set<java.lang.String> |
getImmutableFieldTypes() |
protected java.lang.String[] |
getLanguageKeys(java.util.regex.Matcher matcher) |
protected static int |
getLeadingTabCount(java.lang.String line) |
protected java.lang.String |
getMainReleaseVersion() |
java.util.List<java.lang.String> |
getModifiedFileNames() |
protected java.util.Properties |
getModuleLanguageProperties(java.lang.String fileName) |
protected java.lang.String |
getProperty(java.lang.String key) |
protected java.util.List<java.lang.String> |
getPropertyList(java.lang.String key) |
protected java.util.List<java.lang.String> |
getRunOutsidePortalExclusionPaths() |
protected boolean |
hasMissingParentheses(java.lang.String s) |
protected boolean |
hasRedundantParentheses(java.lang.String s) |
protected boolean |
hasRedundantParentheses(java.lang.String s,
java.lang.String operator1,
java.lang.String operator2) |
protected boolean |
isAttributName(java.lang.String attributeName) |
protected static boolean |
isExcludedFile(java.util.List<java.lang.String> exclusionFiles,
java.lang.String absolutePath) |
protected static boolean |
isExcludedFile(java.util.List<java.lang.String> exclusionFiles,
java.lang.String absolutePath,
int lineCount) |
protected static boolean |
isExcludedFile(java.util.List<java.lang.String> exclusionFiles,
java.lang.String absolutePath,
int lineCount,
java.lang.String javaTermName) |
protected static boolean |
isExcludedPath(java.util.List<java.lang.String> exclusionPaths,
java.lang.String absolutePath) |
protected boolean |
isModulesFile(java.lang.String absolutePath) |
protected void |
postFormat() |
protected void |
processErrorMessage(java.lang.String fileName,
java.lang.String message) |
protected void |
processFormattedFile(java.io.File file,
java.lang.String fileName,
java.lang.String content,
java.lang.String newContent) |
protected java.lang.String |
replacePrimitiveWrapperInstantiation(java.lang.String line) |
void |
setSourceFormatterArgs(SourceFormatterArgs sourceFormatterArgs) |
protected java.lang.String |
sortAttributes(java.lang.String fileName,
java.lang.String line,
int lineCount,
boolean allowApostropheDelimeter) |
protected java.lang.String |
sortHTMLAttributes(java.lang.String line,
java.lang.String value,
java.lang.String attributeAndValue) |
protected static java.lang.String |
stripQuotes(java.lang.String s,
char delimeter) |
protected java.lang.String |
stripRedundantParentheses(java.lang.String s) |
protected java.lang.String |
trimContent(java.lang.String content,
boolean allowLeadingSpaces) |
protected java.lang.String |
trimLine(java.lang.String line,
boolean allowLeadingSpaces) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetIncludespublic static final int PORTAL_MAX_DIR_LEVEL
protected static java.util.regex.Pattern attributeNamePattern
protected static java.util.regex.Pattern bndContentDirPattern
protected static java.util.regex.Pattern emptyCollectionPattern
protected static java.util.regex.Pattern javaSourceInsideJSPTagPattern
protected static java.util.regex.Pattern languageKeyPattern
protected static boolean portalSource
protected static java.util.regex.Pattern principalExceptionPattern
protected static java.util.regex.Pattern sessionKeyPattern
protected static java.util.regex.Pattern taglibSessionKeyPattern
protected SourceFormatterArgs sourceFormatterArgs
public final void format()
throws java.lang.Exception
format in interface SourceProcessorjava.lang.Exceptionpublic java.util.List<java.lang.String> getErrorMessages()
getErrorMessages in interface SourceProcessorpublic final java.util.List<java.lang.String> getFileNames()
throws java.lang.Exception
java.lang.Exceptionpublic SourceMismatchException getFirstSourceMismatchException()
getFirstSourceMismatchException in interface SourceProcessorpublic java.util.List<java.lang.String> getModifiedFileNames()
getModifiedFileNames in interface SourceProcessorpublic void setSourceFormatterArgs(SourceFormatterArgs sourceFormatterArgs)
setSourceFormatterArgs in interface SourceProcessorprotected static int getLeadingTabCount(java.lang.String line)
protected static boolean isExcludedFile(java.util.List<java.lang.String> exclusionFiles,
java.lang.String absolutePath)
protected static boolean isExcludedFile(java.util.List<java.lang.String> exclusionFiles,
java.lang.String absolutePath,
int lineCount)
protected static boolean isExcludedFile(java.util.List<java.lang.String> exclusionFiles,
java.lang.String absolutePath,
int lineCount,
java.lang.String javaTermName)
protected static boolean isExcludedPath(java.util.List<java.lang.String> exclusionPaths,
java.lang.String absolutePath)
protected static java.lang.String stripQuotes(java.lang.String s,
char delimeter)
protected void checkEmptyCollection(java.lang.String line,
java.lang.String fileName,
int lineCount)
protected void checkIfClauseParentheses(java.lang.String ifClause,
java.lang.String fileName,
int lineCount)
protected void checkInefficientStringMethods(java.lang.String line,
java.lang.String fileName,
java.lang.String absolutePath,
int lineCount)
protected void checkLanguageKeys(java.lang.String fileName,
java.lang.String content,
java.util.regex.Pattern pattern)
throws java.lang.Exception
java.lang.Exceptionprotected java.lang.String checkPrincipalException(java.lang.String content)
protected void checkResourceUtil(java.lang.String line,
java.lang.String fileName,
int lineCount)
protected void checkStringBundler(java.lang.String line,
java.lang.String fileName,
int lineCount)
protected abstract java.lang.String doFormat(java.io.File file,
java.lang.String fileName,
java.lang.String absolutePath,
java.lang.String content)
throws java.lang.Exception
java.lang.Exceptionprotected abstract java.util.List<java.lang.String> doGetFileNames()
throws java.lang.Exception
java.lang.Exceptionprotected java.lang.String fixCompatClassImports(java.lang.String absolutePath,
java.lang.String content)
throws java.lang.Exception
java.lang.Exceptionprotected java.lang.String fixCopyright(java.lang.String content,
java.lang.String absolutePath,
java.lang.String fileName)
throws java.io.IOException
java.io.IOExceptionprotected java.lang.String fixIncorrectParameterTypeForLanguageUtil(java.lang.String content,
boolean autoFix,
java.lang.String fileName)
protected java.lang.String fixSessionKey(java.lang.String fileName,
java.lang.String content,
java.util.regex.Pattern pattern)
protected final java.lang.String format(java.io.File file,
java.lang.String fileName,
java.lang.String absolutePath,
java.lang.String content)
throws java.lang.Exception
java.lang.Exceptionprotected final void format(java.lang.String fileName)
throws java.lang.Exception
java.lang.Exceptionprotected java.lang.String formatIncorrectSyntax(java.lang.String line,
java.lang.String incorrectSyntax,
java.lang.String correctSyntax,
boolean lineStart)
protected java.lang.String formatJavaTerms(java.lang.String javaClassName,
java.lang.String packagePath,
java.io.File file,
java.lang.String fileName,
java.lang.String absolutePath,
java.lang.String content,
java.lang.String javaClassContent,
int javaClassLineCount,
java.util.List<java.lang.String> checkJavaFieldTypesExclusionFiles,
java.util.List<java.lang.String> javaTermAccessLevelModifierExclusionFiles,
java.util.List<java.lang.String> javaTermSortExclusionFiles,
java.util.List<java.lang.String> testAnnotationsExclusionFiles)
throws java.lang.Exception
java.lang.Exceptionprotected java.lang.String formatTagAttributeType(java.lang.String line,
java.lang.String tag,
java.lang.String attributeAndValue)
throws java.lang.Exception
java.lang.Exceptionprotected java.lang.String formatWhitespace(java.lang.String line,
java.lang.String linePart)
protected java.lang.String formatWhitespace(java.lang.String line,
java.lang.String trimmedLine,
boolean javaSource)
protected java.lang.String getAbsolutePath(java.io.File file)
throws java.lang.Exception
java.lang.Exceptionprotected java.util.Set<java.lang.String> getAnnotationsExclusions()
protected java.util.Properties getBNDFileLanguageProperties(java.lang.String fileName)
throws java.lang.Exception
java.lang.Exceptionprotected java.util.Map<java.lang.String,java.lang.String> getCompatClassNamesMap()
throws java.lang.Exception
java.lang.Exceptionprotected java.lang.String getContent(java.lang.String fileName,
int level)
throws java.io.IOException
java.io.IOExceptionprotected java.lang.String getCustomCopyright(java.lang.String absolutePath)
throws java.io.IOException
java.io.IOExceptionprotected java.io.File getFile(java.lang.String fileName,
int level)
protected java.util.List<java.lang.String> getFileNames(java.lang.String basedir,
java.util.List<java.lang.String> recentChangesFileNames,
java.lang.String[] excludes,
java.lang.String[] includes)
throws java.lang.Exception
java.lang.Exceptionprotected java.util.List<java.lang.String> getFileNames(java.lang.String basedir,
java.lang.String[] excludes,
java.lang.String[] includes)
throws java.lang.Exception
java.lang.Exceptionprotected java.util.List<java.lang.String> getFileNames(java.lang.String[] excludes,
java.lang.String[] includes)
throws java.lang.Exception
java.lang.Exceptionprotected java.util.Set<java.lang.String> getImmutableFieldTypes()
protected java.lang.String[] getLanguageKeys(java.util.regex.Matcher matcher)
protected java.lang.String getMainReleaseVersion()
protected java.util.Properties getModuleLanguageProperties(java.lang.String fileName)
protected java.lang.String getProperty(java.lang.String key)
protected java.util.List<java.lang.String> getPropertyList(java.lang.String key)
protected java.util.List<java.lang.String> getRunOutsidePortalExclusionPaths()
protected boolean hasMissingParentheses(java.lang.String s)
protected boolean hasRedundantParentheses(java.lang.String s)
protected boolean hasRedundantParentheses(java.lang.String s,
java.lang.String operator1,
java.lang.String operator2)
protected boolean isAttributName(java.lang.String attributeName)
protected boolean isModulesFile(java.lang.String absolutePath)
protected void postFormat()
throws java.lang.Exception
java.lang.Exceptionprotected void processErrorMessage(java.lang.String fileName,
java.lang.String message)
protected void processFormattedFile(java.io.File file,
java.lang.String fileName,
java.lang.String content,
java.lang.String newContent)
throws java.io.IOException
java.io.IOExceptionprotected java.lang.String replacePrimitiveWrapperInstantiation(java.lang.String line)
protected java.lang.String sortAttributes(java.lang.String fileName,
java.lang.String line,
int lineCount,
boolean allowApostropheDelimeter)
throws java.lang.Exception
java.lang.Exceptionprotected java.lang.String sortHTMLAttributes(java.lang.String line,
java.lang.String value,
java.lang.String attributeAndValue)
protected java.lang.String stripRedundantParentheses(java.lang.String s)
protected 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)