|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.click.util.ErrorReport
Provides an HTML <div> error report for the display of page error information. This class is used by ErrorPage and ClickServlet for the display of error information.
Field Summary | |
protected int |
columnNumber
The column number of the error, or -1 if not defined. |
protected Throwable |
error
The cause of the error. |
protected boolean |
isParseError
The error is Velocity parsing exception. |
protected boolean |
isProductionMode
The application is in "production" mode flag. |
protected int |
lineNumber
The line number of the error, or -1 if not defined. |
protected Class |
pageClass
The page class which caused the error. |
protected HttpServletRequest |
request
The servlet request. |
protected ServletContext |
servletContext
The servlet context. |
protected String |
sourceName
The name of the error source. |
protected LineNumberReader |
sourceReader
The error souce LineNumberReader. |
Constructor Summary | |
ErrorReport(Throwable error,
Class pageClass,
boolean isProductionMode,
HttpServletRequest request,
ServletContext servletContext)
Create a ErrorReport instance from the given error and page. |
Method Summary | |
protected Throwable |
getCause()
Return the cause of the error. |
protected int |
getColumnNumber()
Return the error source column number, or -1 if not determined. |
protected LineNumberReader |
getJavaSourceReader(String filename)
Return Java Source LineNumberReader for the given filename, or null if not found. |
protected int |
getLineNumber()
Return the error source line number, or -1 if not determined. |
protected String |
getMessage()
Return the error message. |
protected String |
getRenderedSource()
Return a HTML rendered section of the source error with the error line highlighted. |
protected String |
getRenderJavaLine(String line)
Return a HTML rendered Java source line with keywords highlighted using the given line. |
protected String |
getSourceName()
Return the error source name. |
protected LineNumberReader |
getSourceReader()
Return a LineNumberReader for the error source file, or null if not defined. |
protected String |
getStackTrace()
Return a HTML encode stack trace string from the given error. |
protected boolean |
isParseError()
Return true if the error was a Velocity parsing exception. |
protected boolean |
isProductionMode()
Return true if the application is in "production" mode. |
protected String |
renderJavaKeywords(String line,
String keyword)
Render the HTML rendered Java source line with the given keyword highlighted. |
protected boolean |
skipLine()
Return true if the current line read from the source line reader, should be skipped, or false if the current line should be rendered. |
String |
toString()
Return a error report HTML <div> element for the given error and page. |
protected void |
writeMap(Map map,
HtmlStringBuffer buffer)
Write out the map name value pairs as name=value lines to the string buffer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int columnNumber
protected final Throwable error
protected int lineNumber
protected final boolean isParseError
protected final boolean isProductionMode
protected final Class pageClass
protected final HttpServletRequest request
protected final ServletContext servletContext
protected final String sourceName
protected LineNumberReader sourceReader
Constructor Detail |
public ErrorReport(Throwable error, Class pageClass, boolean isProductionMode, HttpServletRequest request, ServletContext servletContext)
error
- the cause of the errorpageClass
- the Page class which caused the errorisProductionMode
- the application is in "production" moderequest
- the page requestservletContext
- the servlet contextMethod Detail |
public String toString()
protected Throwable getCause()
protected int getColumnNumber()
protected boolean isParseError()
protected boolean isProductionMode()
protected int getLineNumber()
protected String getMessage()
protected String getSourceName()
protected LineNumberReader getSourceReader()
protected LineNumberReader getJavaSourceReader(String filename) throws FileNotFoundException
filename
- the name of the Java source file, e.g. /examples/Page.java
FileNotFoundException
- if file could not be foundprotected String getRenderedSource()
protected String getStackTrace()
protected void writeMap(Map map, HtmlStringBuffer buffer)
map
- the Map of name value pairsbuffer
- the string buffer to write out the values toprotected String getRenderJavaLine(String line)
line
- the Java source line to render
protected String renderJavaKeywords(String line, String keyword)
line
- the given Java source line to renderkeyword
- the Java keyword to highlight
protected boolean skipLine()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |