Elexis API documentation
Version 2.1.6 as of December 11 2011

com.healthmarketscience.jackcess
Class ReplacementErrorHandler

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

public class ReplacementErrorHandler
extends java.lang.Object
implements ErrorHandler

Simple implementation of an ErrorHandler which always returns the configured object.

Author:
James Ahlborn

Constructor Summary
ReplacementErrorHandler()
          Constructs a ReplacementErrorHandler which replaces all errored values with null.
ReplacementErrorHandler(java.lang.Object replacement)
          Constructs a ReplacementErrorHandler which replaces all errored values with the given Object.
 
Method Summary
 java.lang.Object handleRowError(Column column, byte[] columnData, Table.RowState rowState, java.lang.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

ReplacementErrorHandler

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


ReplacementErrorHandler

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

Method Detail

handleRowError

public java.lang.Object handleRowError(Column column,
                                       byte[] columnData,
                                       Table.RowState rowState,
                                       java.lang.Exception error)
                                throws java.io.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
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:
java.io.IOException

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis