|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.makumba.devel.LineViewer
public abstract class LineViewer
a viewer that shows everything per line
Field Summary | |
---|---|
protected String |
additionalCodeStyleClasses
|
protected String |
additionalHeaderInfo
Store other info to be displayed in the header |
protected Error |
caughtError
|
protected String |
contextPath
|
protected File |
dir
|
protected boolean |
hideLineNumbers
|
protected Hashtable<String,String> |
importedClasses
|
protected String[] |
importedPackages
Default packages to be known. |
protected String |
jspClasspath
|
protected String |
jspSourceViewExtension
|
protected String |
logicPath
|
protected static String |
PARAM_HIDE_LINES
|
protected Throwable |
parseError
|
protected boolean |
printHeaderFooter
|
protected boolean |
printLineNumbers
|
protected Reader |
reader
|
protected String |
realPath
|
protected HttpServletRequest |
request
|
protected boolean |
searchCompiledJSPClasses
|
protected boolean |
searchJavaClasses
|
protected boolean |
searchJSPPages
|
protected boolean |
searchMDD
|
protected String |
servletPath
|
protected String |
title
|
protected String |
virtualPath
|
Constructor Summary | |
---|---|
LineViewer(boolean printLineNumbers,
HttpServletRequest request)
|
|
LineViewer(boolean printLineNumbers,
HttpServletRequest request,
ServletContext servletContext)
|
Method Summary | |
---|---|
protected void |
addImportedPackages(HashSet<String> newPackages)
|
Class<?> |
findClass(String className)
|
Class<?> |
findClassSimple(String s)
Searches for Java Classes with the given name FIXME: still needed? |
String |
findCompiledJSP(String s)
Find the path to the compiled JSP file from the name of a compiled JSP class |
String |
findCompiledJSPClassName(String compiledJSPDirectory,
String jspPageName)
Find the path to the compiled JSP file from the name of the original JSP page |
String |
findPage(String s)
Finds a JSP page with the given name. |
void |
footer(PrintWriter printWriter)
Write the page footer to the given writer. |
String |
formatClassLink(Class<?> c,
String methodName,
String displayName)
|
String |
formatClassLink(String qualifiedClassName,
String className,
Integer lineNumber)
|
String |
formatJSPLink(String jspPage,
String token,
Integer lineNumber)
|
String |
formatMakumbaLink(String token)
|
String |
formatMDDLink(String mddName)
|
String |
formatSunTaglibLink(String token)
|
File |
getDirectory()
if this resource is actually a directory, returns not null |
String |
getLineTag(String s)
|
StringTokenizer |
getLineTokenizer(String s)
|
Reader |
getReader()
|
String |
htmlEscape(String s)
Escapes a string to HTML-conform format. |
protected void |
intro(PrintWriter printWriter)
Write the page header to the given writer. |
static void |
main(String[] args)
|
String |
parseLine(String s)
Processes one line of code, and adds links for MDDs JSP pages Java Classes from JSP pages generated Java classes Subclasses that want to provide any additional formatting (syntax highlighting, etc) should extend this method, apply their formatting and before/afterwards call this method. |
void |
parseText(PrintWriter writer)
parse the text and write the output |
protected void |
printFileRelations(PrintWriter writer)
|
void |
printLine(PrintWriter printWriter,
String s,
String toPrint)
|
void |
printPageBegin(PrintWriter writer)
Write the beginning of the page to the given writer. |
protected void |
printPageBeginAdditional(PrintWriter printWriter)
|
void |
printPageEnd(PrintWriter writer)
|
protected String |
printVersionControlLink()
Prints a link to the page CVS/SVN for the file currently viewed. |
(package private) void |
readFromURL(URL u)
|
void |
setSearchLevels(boolean searchJSPPages,
boolean searchCompiledJSPClasses,
boolean searchJavaClasses,
boolean searchMDD)
Sets the amount of links to other files the viewer is trying to find. changing some of these parameters can significantely speed up the viewing process. |
protected void |
writeAdditionalLinks(PrintWriter writer)
|
protected void |
writeLineNumber(PrintWriter writer,
int n,
boolean initialVisibility)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String PARAM_HIDE_LINES
protected String realPath
protected String additionalHeaderInfo
protected String virtualPath
protected String contextPath
protected Reader reader
protected boolean printLineNumbers
protected File dir
protected String title
protected boolean searchJSPPages
protected boolean searchCompiledJSPClasses
protected boolean searchJavaClasses
protected boolean searchMDD
protected String jspSourceViewExtension
protected String jspClasspath
protected HttpServletRequest request
protected String servletPath
protected String logicPath
protected String additionalCodeStyleClasses
protected boolean hideLineNumbers
protected String[] importedPackages
JavaParseData.getImportedPackages()
to add more
protected Hashtable<String,String> importedClasses
protected Error caughtError
protected boolean printHeaderFooter
protected Throwable parseError
Constructor Detail |
---|
public LineViewer(boolean printLineNumbers, HttpServletRequest request)
public LineViewer(boolean printLineNumbers, HttpServletRequest request, ServletContext servletContext)
Method Detail |
---|
protected void addImportedPackages(HashSet<String> newPackages)
public File getDirectory()
getDirectory
in interface SourceViewer
public Reader getReader()
void readFromURL(URL u) throws IOException
IOException
public void parseText(PrintWriter writer) throws IOException
parseText
in interface SourceViewer
IOException
protected void writeLineNumber(PrintWriter writer, int n, boolean initialVisibility)
public void printPageEnd(PrintWriter writer) throws IOException
writer
-
IOException
public void printPageBegin(PrintWriter writer) throws IOException
IOException
protected void printFileRelations(PrintWriter writer)
protected void intro(PrintWriter printWriter) throws IOException
IOException
protected void printPageBeginAdditional(PrintWriter printWriter) throws IOException
IOException
protected String printVersionControlLink()
protected void writeAdditionalLinks(PrintWriter writer)
public void footer(PrintWriter printWriter) throws IOException
IOException
public void printLine(PrintWriter printWriter, String s, String toPrint) throws IOException
IOException
public String getLineTag(String s)
public void setSearchLevels(boolean searchJSPPages, boolean searchCompiledJSPClasses, boolean searchJavaClasses, boolean searchMDD)
searchJSPPages
- whether to search for .jsp files.searchCompiledJSPClasses
- wheter to search for compiled jsp files, i.e. files with the extension _jsp.javasearchJavaClasses
- wheter to search for java source files.searchMDD
- whether to search for Makumba Data Definitions, .mdd files (and Inlcuded Data Defitions, .idd).public String parseLine(String s)
setSearchLevels
method to specify for what types of files are searched for.
s
- the unformatted code line.
public String formatJSPLink(String jspPage, String token, Integer lineNumber)
jspPage
- result
- token
- public String formatClassLink(String qualifiedClassName, String className, Integer lineNumber)
className
- token
-
public String formatMDDLink(String mddName)
token
-
public String formatMakumbaLink(String token)
result
- token
- public String formatSunTaglibLink(String token)
token
-
public StringTokenizer getLineTokenizer(String s)
s
-
public String findPage(String s)
s
- The page to search for
null
otherwisepublic Class<?> findClassSimple(String s)
s
- The class name to search for
null
otherwise.public String findCompiledJSP(String s)
public String findCompiledJSPClassName(String compiledJSPDirectory, String jspPageName)
public String htmlEscape(String s)
s
- The string to escape
public Class<?> findClass(String className)
token
-
public String formatClassLink(Class<?> c, String methodName, String displayName)
public static void main(String[] args)
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |