freemarker.template
Interface TemplateRuntimeHandler

All Known Implementing Classes:
SimpleEventAdapter, TemplateEventAdapter

public interface TemplateRuntimeHandler

Interface for handling events that occur during FM-Classic template runtime. This can be implemented by adapter classes, or can be handled directly.

Since:
1.8
See Also:
TemplateExceptionEvent, TemplateExceptionListener

Field Summary
static int SEVERITY_DEPRECATION
          Used whenever a deprecated construct is encountered.
static int SEVERITY_ERROR
          A severe error has occurred, that may prevent FM-Classic from processing the template.
static int SEVERITY_WARNING
          An error that is non-critical to the continuation of processing.
 
Method Summary
 void fireExceptionThrown(java.lang.Object source, java.lang.Exception exception, java.io.Writer output, java.lang.String sourceName, int severity)
          Fires a TemplateExceptionEvent to indicate that an exception has occurred in the FM-Classic runtime.
 

Field Detail

SEVERITY_ERROR

static final int SEVERITY_ERROR
A severe error has occurred, that may prevent FM-Classic from processing the template.

See Also:
Constant Field Values

SEVERITY_WARNING

static final int SEVERITY_WARNING
An error that is non-critical to the continuation of processing.

See Also:
Constant Field Values

SEVERITY_DEPRECATION

static final int SEVERITY_DEPRECATION
Used whenever a deprecated construct is encountered.

See Also:
Constant Field Values
Method Detail

fireExceptionThrown

void fireExceptionThrown(java.lang.Object source,
                         java.lang.Exception exception,
                         java.io.Writer output,
                         java.lang.String sourceName,
                         int severity)
Fires a TemplateExceptionEvent to indicate that an exception has occurred in the FM-Classic runtime. Implementations can use this method to pass the event to TemplateExceptionListener objects.

Parameters:
source - the source object of the event
exception - the exception that caused the event to be fired
output - the current Template output stream
sourceName - the name of the source class and method that fired the event
severity - the severity of the exception