org.apache.jasper.compiler

Class ErrorDispatcher

public class ErrorDispatcher extends Object

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
ErrorDispatcher(boolean jspcMode)
Method Summary
static JavacErrorDetailcreateJavacError(String fname, Node.Nodes page, StringBuffer errMsgBuf, int lineNum)
static JavacErrorDetailcreateJavacError(String fname, Node.Nodes page, StringBuffer errMsgBuf, int lineNum, JspCompilationContext ctxt)
voidjavacError(JavacErrorDetail[] javacErrors)
voidjavacError(String errorReport, Exception e)
voidjspError(String errCode)
voidjspError(Mark where, String errCode)
voidjspError(Node n, String errCode)
voidjspError(String errCode, String arg)
voidjspError(Mark where, String errCode, String arg)
voidjspError(Node n, String errCode, String arg)
voidjspError(String errCode, String arg1, String arg2)
voidjspError(String errCode, String arg1, String arg2, String arg3)
voidjspError(Mark where, String errCode, String arg1, String arg2)
voidjspError(Mark where, String errCode, String arg1, String arg2, String arg3)
voidjspError(Node n, String errCode, String arg1, String arg2)
voidjspError(Node n, String errCode, String arg1, String arg2, String arg3)
voidjspError(Exception e)
voidjspError(String errCode, String arg, Exception e)
voidjspError(Node n, String errCode, String arg, Exception e)
static JavacErrorDetail[]parseJavacErrors(String errMsg, String fname, Node.Nodes page)
Parses the given error message into an array of javac compilation error messages (one per javac compilation error line number).

Constructor Detail

ErrorDispatcher

public ErrorDispatcher(boolean jspcMode)

Method Detail

createJavacError

public static JavacErrorDetail createJavacError(String fname, Node.Nodes page, StringBuffer errMsgBuf, int lineNum)

Parameters: fname page errMsgBuf lineNum

Returns: JavacErrorDetail The error details

Throws: JasperException

createJavacError

public static JavacErrorDetail createJavacError(String fname, Node.Nodes page, StringBuffer errMsgBuf, int lineNum, JspCompilationContext ctxt)

Parameters: fname page errMsgBuf lineNum ctxt

Returns: JavacErrorDetail The error details

Throws: JasperException

javacError

public void javacError(JavacErrorDetail[] javacErrors)

javacError

public void javacError(String errorReport, Exception e)

jspError

public void jspError(String errCode)

jspError

public void jspError(Mark where, String errCode)

jspError

public void jspError(Node n, String errCode)

jspError

public void jspError(String errCode, String arg)

jspError

public void jspError(Mark where, String errCode, String arg)

jspError

public void jspError(Node n, String errCode, String arg)

jspError

public void jspError(String errCode, String arg1, String arg2)

jspError

public void jspError(String errCode, String arg1, String arg2, String arg3)

jspError

public void jspError(Mark where, String errCode, String arg1, String arg2)

jspError

public void jspError(Mark where, String errCode, String arg1, String arg2, String arg3)

jspError

public void jspError(Node n, String errCode, String arg1, String arg2)

jspError

public void jspError(Node n, String errCode, String arg1, String arg2, String arg3)

jspError

public void jspError(Exception e)

jspError

public void jspError(String errCode, String arg, Exception e)

jspError

public void jspError(Node n, String errCode, String arg, Exception e)

parseJavacErrors

public static JavacErrorDetail[] parseJavacErrors(String errMsg, String fname, Node.Nodes page)
Parses the given error message into an array of javac compilation error messages (one per javac compilation error line number).

Parameters: errMsg Error message fname Name of Java source file whose compilation failed page 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

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.