org.apache.click.service
Class TemplateException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.apache.click.service.TemplateException
All Implemented Interfaces:
Serializable

public class TemplateException
extends Exception

Provides a template exception class for use by the template service. This is used to wrap TemplateService exceptions and provide error diagnostics such as line and column where error occurred.

See Also:
Serialized Form

Constructor Summary
TemplateException(Exception cause)
          Create a template service exception with the given cause.
TemplateException(Exception cause, String templateName, int lineNumber, int columnNumber)
          Create a template service exception with the given cause, template name, line number and column number.
 
Method Summary
 Throwable fillInStackTrace()
          Fills in the execution stack trace.
 int getColumnNumber()
          Return the template column number where this exception occurred.
 int getLineNumber()
          Return the template the line number where this exception occurred.
 String getTemplateName()
          Return the Template name where this exception occurred.
 boolean isParseError()
          Return true if a template parsing error.
 void printStackTrace(PrintStream printStream)
          Prints the cause and its backtrace to the specified print stream.
 void printStackTrace(PrintWriter printWriter)
          Prints the cause and its backtrace to the specified print writer.
 String toString()
           
 
Methods inherited from class java.lang.Throwable
getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TemplateException

public TemplateException(Exception cause)
Create a template service exception with the given cause.

Parameters:
cause - the underlying cause of the template service error

TemplateException

public TemplateException(Exception cause,
                         String templateName,
                         int lineNumber,
                         int columnNumber)
Create a template service exception with the given cause, template name, line number and column number.

Parameters:
cause - the underlying cause of the template service error
templateName - the name of the template which cause the error
lineNumber - the template error line number
columnNumber - the template error column number
Method Detail

getColumnNumber

public int getColumnNumber()
Return the template column number where this exception occurred.

Returns:
the template column number where this exception occurred

getLineNumber

public int getLineNumber()
Return the template the line number where this exception occurred.

Returns:
the template the line number where this exception occurred

getTemplateName

public String getTemplateName()
Return the Template name where this exception occurred.

Returns:
the Template name where this exception occurred

isParseError

public boolean isParseError()
Return true if a template parsing error.

Returns:
true if a template parsing error

printStackTrace

public void printStackTrace(PrintStream printStream)
Prints the cause and its backtrace to the specified print stream.

Overrides:
printStackTrace in class Throwable
Parameters:
printStream - the printStream to print the stack trace to

printStackTrace

public void printStackTrace(PrintWriter printWriter)
Prints the cause and its backtrace to the specified print writer.

Overrides:
printStackTrace in class Throwable
Parameters:
printWriter - the printWriter to writer the stack trace to

fillInStackTrace

public Throwable fillInStackTrace()
Fills in the execution stack trace. This method records within this Throwable object information about the current state of the stack frames for the current thread.

Overrides:
fillInStackTrace in class Throwable
Returns:
a reference to this Throwable instance

toString

public String toString()
Overrides:
toString in class Throwable
Returns:
the string representation of this error
See Also:
Object.toString()