com.acsinet_solutions.util.exception
Class AbstractExceptionDataWriter

java.lang.Object
  extended by com.acsinet_solutions.util.exception.AbstractExceptionDataWriter
All Implemented Interfaces:
ExceptionDataWriter
Direct Known Subclasses:
HTMLExceptionDataWriter, SimpleExceptionDataWriter

public abstract class AbstractExceptionDataWriter
extends java.lang.Object
implements ExceptionDataWriter

Base class for exception data writer concrete implementations.

Author:
Santiago Arriaga

Constructor Summary
AbstractExceptionDataWriter()
           
 
Method Summary
protected abstract  void endException()
          Exception end
protected  int getStop(ExceptionData data)
          Get the stop condition, by default, it is the first different index.
protected abstract  void printMessage(java.lang.String message)
          Print message for an exception
protected abstract  void printStackTraceEntry(int line, java.lang.String entry)
          Print an stack trace entry
protected abstract  void startException(boolean start)
          Exception starts
 void write(java.lang.Throwable throwable)
          Write the stack trace information about the given Throwable instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractExceptionDataWriter

public AbstractExceptionDataWriter()
Method Detail

write

public final void write(java.lang.Throwable throwable)
                 throws java.io.IOException
Write the stack trace information about the given Throwable instance

Specified by:
write in interface ExceptionDataWriter
Parameters:
throwable - A not-null Throwable instance
Throws:
java.io.IOException

getStop

protected int getStop(ExceptionData data)
Get the stop condition, by default, it is the first different index. This method is overridable.


startException

protected abstract void startException(boolean start)
                                throws java.io.IOException
Exception starts

Parameters:
start - true if this is the first exception; false otherwise
Throws:
java.io.IOException

endException

protected abstract void endException()
                              throws java.io.IOException
Exception end

Throws:
java.io.IOException

printMessage

protected abstract void printMessage(java.lang.String message)
                              throws java.io.IOException
Print message for an exception

Parameters:
message - A not-null String instance
Throws:
java.io.IOException

printStackTraceEntry

protected abstract void printStackTraceEntry(int line,
                                             java.lang.String entry)
                                      throws java.io.IOException
Print an stack trace entry

Parameters:
pos - The nonnegative line position
entry - A not-null String instance
Throws:
java.io.IOException