Class ErrorDispatcher
java.lang.Object
org.apache.sling.scripting.jsp.jasper.compiler.ErrorDispatcher
Class responsible for dispatching JSP parse and javac compilation errors
to the configured error handler.
This class is also responsible for localizing any error codes before they
are passed on to the configured error handler.
In the case of a Java compilation error, the compiler error message is
parsed into an array of JavacErrorDetail instances, which is passed on to
the configured error handler.
- Author:
- Jan Luehe, Kin-man Chung
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic JavacErrorDetailcreateJavacError(String fname, org.apache.sling.scripting.jsp.jasper.compiler.Node.Nodes page, StringBuffer errMsgBuf, int lineNum) static JavacErrorDetailcreateJavacError(String fname, org.apache.sling.scripting.jsp.jasper.compiler.Node.Nodes page, StringBuffer errMsgBuf, int lineNum, JspCompilationContext ctxt) voidjavacError(String errorReport, Exception e) voidjavacError(JavacErrorDetail[] javacErrors) voidvoidvoidvoidvoidvoidvoidvoidvoidjspError(org.apache.sling.scripting.jsp.jasper.compiler.Mark where, String errCode, String arg1, String arg2) voidjspError(org.apache.sling.scripting.jsp.jasper.compiler.Mark where, String errCode, String arg1, String arg2, String arg3) voidvoidvoidjspError(org.apache.sling.scripting.jsp.jasper.compiler.Node n, String errCode, String arg, Exception e) voidjspError(org.apache.sling.scripting.jsp.jasper.compiler.Node n, String errCode, String arg1, String arg2) voidjspError(org.apache.sling.scripting.jsp.jasper.compiler.Node n, String errCode, String arg1, String arg2, String arg3) static JavacErrorDetail[]parseJavacErrors(String errMsg, String fname, org.apache.sling.scripting.jsp.jasper.compiler.Node.Nodes page) Parses the given error message into an array of javac compilation error messages (one per javac compilation error line number).
-
Constructor Details
-
ErrorDispatcher
public ErrorDispatcher(boolean jspcMode)
-
-
Method Details
-
jspError
- Throws:
JasperException
-
jspError
public void jspError(org.apache.sling.scripting.jsp.jasper.compiler.Mark where, String errCode) throws JasperException - Throws:
JasperException
-
jspError
public void jspError(org.apache.sling.scripting.jsp.jasper.compiler.Node n, String errCode) throws JasperException - Throws:
JasperException
-
jspError
- Throws:
JasperException
-
jspError
public void jspError(org.apache.sling.scripting.jsp.jasper.compiler.Mark where, String errCode, String arg) throws JasperException - Throws:
JasperException
-
jspError
public void jspError(org.apache.sling.scripting.jsp.jasper.compiler.Node n, String errCode, String arg) throws JasperException - Throws:
JasperException
-
jspError
- Throws:
JasperException
-
jspError
- Throws:
JasperException
-
jspError
public void jspError(org.apache.sling.scripting.jsp.jasper.compiler.Mark where, String errCode, String arg1, String arg2) throws JasperException - Throws:
JasperException
-
jspError
public void jspError(org.apache.sling.scripting.jsp.jasper.compiler.Mark where, String errCode, String arg1, String arg2, String arg3) throws JasperException - Throws:
JasperException
-
jspError
public void jspError(org.apache.sling.scripting.jsp.jasper.compiler.Node n, String errCode, String arg1, String arg2) throws JasperException - Throws:
JasperException
-
jspError
public void jspError(org.apache.sling.scripting.jsp.jasper.compiler.Node n, String errCode, String arg1, String arg2, String arg3) throws JasperException - Throws:
JasperException
-
jspError
- Throws:
JasperException
-
jspError
- Throws:
JasperException
-
jspError
public void jspError(org.apache.sling.scripting.jsp.jasper.compiler.Node n, String errCode, String arg, Exception e) throws JasperException - Throws:
JasperException
-
parseJavacErrors
public static JavacErrorDetail[] parseJavacErrors(String errMsg, String fname, org.apache.sling.scripting.jsp.jasper.compiler.Node.Nodes page) throws JasperException, IOException Parses the given error message into an array of javac compilation error messages (one per javac compilation error line number).- Parameters:
errMsg- Error messagefname- Name of Java source file whose compilation failedpage- Node representation of JSP page from which the Java source file was generated- Returns:
- Array of javac compilation errors, or null if the given error message does not contain any compilation error line numbers
- Throws:
JasperExceptionIOException
-
javacError
- Throws:
JasperException
-
javacError
- Throws:
JasperException
-
createJavacError
public static JavacErrorDetail createJavacError(String fname, org.apache.sling.scripting.jsp.jasper.compiler.Node.Nodes page, StringBuffer errMsgBuf, int lineNum) throws JasperException - Parameters:
fname-page-errMsgBuf-lineNum-- Returns:
- JavacErrorDetail The error details
- Throws:
JasperException
-
createJavacError
public static JavacErrorDetail createJavacError(String fname, org.apache.sling.scripting.jsp.jasper.compiler.Node.Nodes page, StringBuffer errMsgBuf, int lineNum, JspCompilationContext ctxt) throws JasperException - Parameters:
fname-page-errMsgBuf-lineNum-ctxt-- Returns:
- JavacErrorDetail The error details
- Throws:
JasperException
-