com.healthmarketscience.jackcess.util
Class ReplacementErrorHandler
java.lang.Object
com.healthmarketscience.jackcess.util.ReplacementErrorHandler
- All Implemented Interfaces:
- ErrorHandler
- Direct Known Subclasses:
- DebugErrorHandler
public class ReplacementErrorHandler
- extends Object
- implements ErrorHandler
Simple implementation of an ErrorHandler which always returns the
configured object.
- Author:
- James Ahlborn
- Usage:
- : This class requires moderate API knowledge.
Constructor Summary |
ReplacementErrorHandler()
Constructs a ReplacementErrorHandler which replaces all errored values
with null . |
ReplacementErrorHandler(Object replacement)
Constructs a ReplacementErrorHandler which replaces all errored values
with the given Object. |
ReplacementErrorHandler
public ReplacementErrorHandler()
- Constructs a ReplacementErrorHandler which replaces all errored values
with
null
.
ReplacementErrorHandler
public ReplacementErrorHandler(Object replacement)
- Constructs a ReplacementErrorHandler which replaces all errored values
with the given Object.
handleRowError
public Object handleRowError(Column column,
byte[] columnData,
ErrorHandler.Location location,
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
- Parameters:
column
- the info for the column being readcolumnData
- the actual column data for the column being read (which
may be null
depending 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
Copyright © 2005–2018 Health Market Science. All rights reserved.