|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.makumba.analyser.engine.JspParseData
public class JspParseData
This class performs a rudimentary detection of JSP-relevant tags in a JSP page.
Field Summary | |
---|---|
(package private) static int |
analyzedPages
Cache of all page analyses. |
(package private) JspAnalyzer |
analyzer
The analyzer plugged in. |
(package private) File |
file
The JSP file path |
(package private) Object |
holder
The holder of the analysis status, and partial results. |
(package private) SourceSyntaxPoints |
syntaxPoints
The syntax points of this page. |
(package private) String |
uri
The JSP URI, for debugging purposes. |
Constructor Summary | |
---|---|
JspParseData(String path,
String uri,
JspAnalyzer an)
Private constructor, construction can only be made by getParseData(). |
Method Summary | |
---|---|
(package private) static String |
attribute(String attName)
|
(package private) static String |
attribute(String attName,
String quote)
This helps to create regex for the 'attribute' pattern easily. |
void |
discardParsingData()
Releases parsing data that is useful during analysis and for error handling, but not needed anymore afterwards |
static void |
fill(Tag t,
Map<String,String> attributes)
Fills the data for a tag by invoking the setter method through Java reflexion |
Object |
getAnalysisResult(Object initStatus)
Performs the analysis if not performed already, or if the file has changed. |
String[] |
getCommentPatternNames()
|
Pattern[] |
getCommentPatterns()
|
Pattern |
getIncludePattern()
|
String |
getIncludePatternName()
|
String[] |
getLiteralPatternNames()
|
Pattern[] |
getLiteralPatterns()
|
static JspParseData |
getParseData(String webappRoot,
String path,
JspAnalyzer an)
Returns the pageData of the page at the given path in the given webapp. |
SyntaxPoint[] |
getSyntaxPointArray(Object initStatus)
|
SourceSyntaxPoints |
getSyntaxPoints()
Gets the collection of syntax points. |
boolean |
isUsingHibernate()
|
(package private) void |
parse(Object initStatus)
Parses the file. |
(package private) Map<String,String> |
parseAttributes(String s,
int origin)
Identifies tag attributes from a tag string and puts them in a Map. |
static void |
tagDataLine(ElementData td,
StringBuffer sb)
Prints the line of a tag and points the beginning of the tag. |
(package private) void |
treatELExpression(Matcher m,
String content,
JspAnalyzer an,
boolean isJsf)
Treats a single EL expression, extracts all the maps of the kind Expr[...] |
void |
treatInclude(int position,
String includeDirective,
SyntaxPoint start,
SyntaxPoint end,
SourceSyntaxPoints host)
Treats include directives in the page |
(package private) void |
treatIncludeDirective(String directive,
SyntaxPoint start,
SyntaxPoint end,
JspAnalyzer an)
Treats an include directive: parses its different parts and stores the analysis. |
(package private) void |
treatPageContent(String content,
JspAnalyzer an)
Goes through the page and matches tags, system tags, and EL expressions in such a way that the calls to the handling methods happen in sequential order. |
(package private) void |
treatSystemTag(Matcher m,
String content,
JspAnalyzer an)
Treats a system tag: parses its different parts and stores the analysis. |
(package private) void |
treatTag(Matcher m,
String content,
JspAnalyzer an)
Treats a jsp or taglib tag: parses its different parts and stores the analysis. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
File file
JspAnalyzer analyzer
SourceSyntaxPoints syntaxPoints
Object holder
String uri
static int analyzedPages
Constructor Detail |
---|
public JspParseData(String path, String uri, JspAnalyzer an)
path
- the path to the pageuri
- the uri, for debugging purposesan
- the analyzer used for analysisMethod Detail |
---|
static String attribute(String attName)
static String attribute(String attName, String quote)
attName
- the name of the attributequote
- the kind of quote used. Is either " or ' .public void discardParsingData()
public Object getAnalysisResult(Object initStatus)
initStatus
- an initial status to be passed to the JspAnalyzer. For example, the pageContext for an example-based
analyzerpublic SyntaxPoint[] getSyntaxPointArray(Object initStatus)
getSyntaxPointArray
in interface SourceSyntaxPoints.PreprocessorClient
public static JspParseData getParseData(String webappRoot, String path, JspAnalyzer an)
webappRoot
- the root of the webapppath
- the path to the filethe
- JspAnalyzer used to parse the pagepublic SourceSyntaxPoints getSyntaxPoints()
getSyntaxPoints
in interface SourceSyntaxPoints.PreprocessorClient
void parse(Object initStatus)
initStatus
- an initial status to be passed to the JspAnalyzer. For example, the pageContext for an example-based
analyzerMap<String,String> parseAttributes(String s, int origin)
s
- the tag string to be parsedorigin
- the origin of the string in the parsed pagepublic void treatInclude(int position, String includeDirective, SyntaxPoint start, SyntaxPoint end, SourceSyntaxPoints host)
treatInclude
in interface SourceSyntaxPoints.PreprocessorClient
position
- position of the include directiveincludeDirective
- include directive to be treatedhost
- SourceSyntaxPoints object that is going to host this included pagepublic Pattern[] getCommentPatterns()
getCommentPatterns
in interface SourceSyntaxPoints.PreprocessorClient
public String[] getCommentPatternNames()
getCommentPatternNames
in interface SourceSyntaxPoints.PreprocessorClient
public Pattern getIncludePattern()
getIncludePattern
in interface SourceSyntaxPoints.PreprocessorClient
public String getIncludePatternName()
getIncludePatternName
in interface SourceSyntaxPoints.PreprocessorClient
void treatPageContent(String content, JspAnalyzer an)
content
- the content of the pagean
- a JspAnalyzer
implementationvoid treatELExpression(Matcher m, String content, JspAnalyzer an, boolean isJsf)
m
- the Matcher used to parse the expressioncontent
- the content of the pagean
- the JspAnalyzer used to analyze the pageisJsf
- whether this is a JSP EL value ${...} or a JSF method #{...}void treatTag(Matcher m, String content, JspAnalyzer an)
m
- the Matcher used to parse the tagcontent
- the content of the pagean
- the JspAnalyzer used to analyze the pagevoid treatSystemTag(Matcher m, String content, JspAnalyzer an)
m
- the Matcher used to parse the tagcontent
- the content of the pagean
- the JspAnalyzer used to analyze the pagevoid treatIncludeDirective(String directive, SyntaxPoint start, SyntaxPoint end, JspAnalyzer an)
m
- the Matcher used to parse the directivedirective
- the content of the pagean
- the JspAnalyzer used to analyze the pagepublic static void tagDataLine(ElementData td, StringBuffer sb)
td
- the TagData of the tagsb
- the StringBuffer used to print outpublic static void fill(Tag t, Map<String,String> attributes)
t
- the tag to be filled with dataattributes
- the attributes of the tagpublic boolean isUsingHibernate()
public String[] getLiteralPatternNames()
getLiteralPatternNames
in interface SourceSyntaxPoints.PreprocessorClient
public Pattern[] getLiteralPatterns()
getLiteralPatterns
in interface SourceSyntaxPoints.PreprocessorClient
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |