Class DebugErrorHandler
- java.lang.Object
-
- com.healthmarketscience.jackcess.util.ReplacementErrorHandler
-
- com.healthmarketscience.jackcess.util.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, seeReplacementErrorHandler.- Author:
- James Ahlborn
- Usage:
- General: This class is general use.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.healthmarketscience.jackcess.util.ErrorHandler
ErrorHandler.Location
-
-
Field Summary
-
Fields inherited from interface com.healthmarketscience.jackcess.util.ErrorHandler
DEFAULT
-
-
Constructor Summary
Constructors Constructor Description DebugErrorHandler()Constructs a DebugErrorHandler which replaces all errored values withnull.DebugErrorHandler(Object replacement)Constructs a DebugErrorHandler which replaces all errored values with the given Object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjecthandleRowError(Column column, byte[] columnData, ErrorHandler.Location location, Exception error)Handles an error encountered while reading a column of data from a Table row.
-
-
-
Constructor Detail
-
DebugErrorHandler
public DebugErrorHandler()
Constructs a DebugErrorHandler which replaces all errored values withnull.
-
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, ErrorHandler.Location location, Exception error) throws IOException
Description copied from interface:ErrorHandlerHandles 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:
handleRowErrorin interfaceErrorHandler- Overrides:
handleRowErrorin classReplacementErrorHandler- Parameters:
column- the info for the column being readcolumnData- the actual column data for the column being read (which may benulldepending on when the exception was thrown during the reading process)location- the current location of the errorerror- the error that was encountered- Returns:
- replacement for this row's column
- Throws:
IOException
-
-