com.healthmarketscience.jackcess
Class DebugErrorHandler

java.lang.Object
  extended by com.healthmarketscience.jackcess.ReplacementErrorHandler
      extended by com.healthmarketscience.jackcess.DebugErrorHandler
All Implemented Interfaces:
ErrorHandler

public class DebugErrorHandler
extends ReplacementErrorHandler

Implementation of ErrorHandler which is useful for generating debug information about bad row data (great for bug reports!). After logging a debug entry for the failed column, it will return some sort of replacement value, see ReplacementErrorHandler.

Author:
James Ahlborn

Constructor Summary
DebugErrorHandler()
          Constructs a DebugErrorHandler which replaces all errored values with null.
DebugErrorHandler(Object replacement)
          Constructs a DebugErrorHandler which replaces all errored values with the given Object.
 
Method Summary
 Object handleRowError(Column column, byte[] columnData, Table.RowState rowState, Exception error)
          Handles an error encountered while reading a column of data from a Table row.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DebugErrorHandler

public DebugErrorHandler()
Constructs a DebugErrorHandler which replaces all errored values with null.


DebugErrorHandler

public DebugErrorHandler(Object replacement)
Constructs a DebugErrorHandler which replaces all errored values with the given Object.

Method Detail

handleRowError

public Object handleRowError(Column column,
                             byte[] columnData,
                             Table.RowState rowState,
                             Exception error)
                      throws IOException
Description copied from interface: ErrorHandler
Handles an error encountered while reading a column of data from a Table row. Handler may either throw an exception (which will be propagated back to the caller) or return a replacement for this row's column value (in which case the row will continue to be read normally).

Specified by:
handleRowError in interface ErrorHandler
Overrides:
handleRowError in class ReplacementErrorHandler
Parameters:
column - the info for the column being read
columnData - the actual column data for the column being read (which may be null depending on when the exception was thrown during the reading process)
rowState - the current row state for the caller
error - the error that was encountered
Returns:
replacement for this row's column
Throws:
IOException


Copyright © 2005-2013 Health Market Science. All Rights Reserved.