com.virtuosotechnologies.lib.error
Class StackTraceExceptionFormatter

java.lang.Object
  extended bycom.virtuosotechnologies.lib.error.StackTraceExceptionFormatter
All Implemented Interfaces:
ExceptionFormatter

public class StackTraceExceptionFormatter
extends Object
implements ExceptionFormatter

Exception formatter that creates full stack traces. This uses two templates, both MessageFormat patterns.

The exception template accepts the following parameters:

The stack trace element template accepts the following parameters:

This class is fully synchronized and thread-safe.


Constructor Summary
StackTraceExceptionFormatter()
          Construct a formatter using the default templates
 
Method Summary
 String format(Throwable ex, PropertySet properties)
          Generate a String representation of the given exception.
 void setExceptionTemplate(String template)
          Set the template for exceptions
 void setStackTraceElementTemplate(String template)
          Set the template for stack trace elements
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StackTraceExceptionFormatter

public StackTraceExceptionFormatter()
Construct a formatter using the default templates

Method Detail

setExceptionTemplate

public void setExceptionTemplate(String template)
Set the template for exceptions

Parameters:
template - new template String

setStackTraceElementTemplate

public void setStackTraceElementTemplate(String template)
Set the template for stack trace elements

Parameters:
template - new template String

format

public String format(Throwable ex,
                     PropertySet properties)
Generate a String representation of the given exception.

Specified by:
format in interface ExceptionFormatter
Parameters:
ex - throwable
properties - formatter-specific properties.
Returns:
a formatted String.