com.liferay.portal.tools.sourceformatter
Class JSPSourceProcessor
java.lang.Object
com.liferay.portal.tools.sourceformatter.BaseSourceProcessor
com.liferay.portal.tools.sourceformatter.JSPSourceProcessor
- All Implemented Interfaces:
- SourceProcessor
public class JSPSourceProcessor
- extends BaseSourceProcessor
Fields inherited from class com.liferay.portal.tools.sourceformatter.BaseSourceProcessor |
BASEDIR, fileUtil, languageKeyPattern, MAIN_RELEASE_VERSION_6_1_0, MAIN_RELEASE_VERSION_6_2_0, mainReleaseVersion, portalSource, saxReaderUtil, sessionKeyPattern, sourceFormatterHelper, taglibSessionKeyPattern |
Method Summary |
protected void |
addImportCounts(String content)
|
protected void |
addJSPIncludeFileNames(String fileName,
Set<String> includeFileNames)
|
protected void |
addJSPReferenceFileNames(String fileName,
Set<String> includeFileNames)
|
protected void |
addJSPUnusedImports(String fileName,
List<String> importLines,
List<String> unneededImports)
|
protected boolean |
checkTaglibVulnerability(String jspContent,
String vulnerability)
|
protected void |
checkXSS(String fileName,
String jspContent)
|
protected void |
format()
|
protected String |
format(String fileName)
|
protected String |
formatJSP(String fileName,
String content)
|
protected String |
formatTaglibQuotes(String fileName,
String content,
String quoteType)
|
protected List<String> |
getJSPDuplicateImports(String fileName,
String content,
List<String> importLines)
|
protected String |
getTaglibRegex(String quoteType)
|
protected String |
getVariableName(String line)
|
protected boolean |
hasUnusedVariable(String fileName,
String line)
|
protected boolean |
isClassOrVariableRequired(String fileName,
String name,
Set<String> includeFileNames,
Set<String> checkedFileNames)
|
protected boolean |
isJSPAttributName(String attributeName)
|
protected boolean |
isJSPDuplicateImport(String fileName,
String importLine,
boolean checkFile)
|
protected void |
moveFrequentlyUsedImportsToCommonInit(int minCount)
|
protected String |
sortJSPAttributes(String fileName,
String line,
int lineCount)
|
protected String |
stripJSPImports(String fileName,
String content)
|
Methods inherited from class com.liferay.portal.tools.sourceformatter.BaseSourceProcessor |
checkIfClauseParentheses, checkInefficientStringMethods, checkLanguageKeys, checkStringBundler, fixCompatClassImports, fixCopyright, fixSessionKey, format, format, formatImports, getCompatClassNamesMap, getCopyright, getCustomCopyright, getErrorMessages, getExclusionsProperties, getFileNames, getFileNames, getLanguageKeys, getOldCopyright, hasMissingParentheses, hasRedundantParentheses, isAutoFix, processErrorMessage, replacePrimitiveWrapperInstantiation, stripQuotes, stripRedundantParentheses, stripTopLevelDirectories, trimContent, trimLine |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JSPSourceProcessor
public JSPSourceProcessor()
addImportCounts
protected void addImportCounts(String content)
addJSPIncludeFileNames
protected void addJSPIncludeFileNames(String fileName,
Set<String> includeFileNames)
addJSPReferenceFileNames
protected void addJSPReferenceFileNames(String fileName,
Set<String> includeFileNames)
addJSPUnusedImports
protected void addJSPUnusedImports(String fileName,
List<String> importLines,
List<String> unneededImports)
checkTaglibVulnerability
protected boolean checkTaglibVulnerability(String jspContent,
String vulnerability)
checkXSS
protected void checkXSS(String fileName,
String jspContent)
format
protected void format()
throws Exception
- Specified by:
format
in class BaseSourceProcessor
- Throws:
Exception
format
protected String format(String fileName)
throws Exception
- Overrides:
format
in class BaseSourceProcessor
- Throws:
Exception
formatJSP
protected String formatJSP(String fileName,
String content)
throws IOException
- Throws:
IOException
formatTaglibQuotes
protected String formatTaglibQuotes(String fileName,
String content,
String quoteType)
getJSPDuplicateImports
protected List<String> getJSPDuplicateImports(String fileName,
String content,
List<String> importLines)
getTaglibRegex
protected String getTaglibRegex(String quoteType)
getVariableName
protected String getVariableName(String line)
hasUnusedVariable
protected boolean hasUnusedVariable(String fileName,
String line)
isClassOrVariableRequired
protected boolean isClassOrVariableRequired(String fileName,
String name,
Set<String> includeFileNames,
Set<String> checkedFileNames)
isJSPAttributName
protected boolean isJSPAttributName(String attributeName)
isJSPDuplicateImport
protected boolean isJSPDuplicateImport(String fileName,
String importLine,
boolean checkFile)
moveFrequentlyUsedImportsToCommonInit
protected void moveFrequentlyUsedImportsToCommonInit(int minCount)
throws IOException
- Throws:
IOException
sortJSPAttributes
protected String sortJSPAttributes(String fileName,
String line,
int lineCount)
stripJSPImports
protected String stripJSPImports(String fileName,
String content)
throws IOException
- Throws:
IOException