freemarker.template
Class HtmlExceptionListener

java.lang.Object
  extended by freemarker.template.HtmlExceptionListener
All Implemented Interfaces:
TemplateExceptionListener, java.util.EventListener

public final class HtmlExceptionListener
extends java.lang.Object
implements TemplateExceptionListener

A basic handler that matches FreeMarker template legacy behaviour: any exceptions thrown by FM-Classic are output inside an HTML comment within the body of the output.

Version:
$Id: HtmlExceptionListener.java 1101 2013-04-01 04:17:32Z run2000 $
Author:
Nicholas Cull

Constructor Summary
HtmlExceptionListener()
          Deprecated. use the getInstance() method instead
 
Method Summary
 void exceptionThrown(TemplateExceptionEvent e)
          Handles events that are created whenever an exception is thrown.
static HtmlExceptionListener getInstance()
          Retrieves a singleton instance of this HTML exception listener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlExceptionListener

@Deprecated
public HtmlExceptionListener()
Deprecated. use the getInstance() method instead

Creates new HtmlExceptionListener.

Method Detail

getInstance

public static HtmlExceptionListener getInstance()
Retrieves a singleton instance of this HTML exception listener

Returns:
a singleton instance of this class

exceptionThrown

public void exceptionThrown(TemplateExceptionEvent e)
Handles events that are created whenever an exception is thrown. This handler turns the event into an HTML comment, and is inserted into the current output stream of the Template.

Specified by:
exceptionThrown in interface TemplateExceptionListener