Interface ErrorHandler
-
- All Known Implementing Classes:
DebugErrorHandler,ReplacementErrorHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ErrorHandler
Handler for errors encountered while reading a column of row data from a Table. An instance of this class may be configured at the Database, Table, or Cursor level to customize error handling as desired. The default instance used isDEFAULT, which just rethrows any exceptions encountered.- Author:
- James Ahlborn
- Usage:
- Intermediate: This class requires moderate API knowledge.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceErrorHandler.LocationProvides location information for an error.
-
Field Summary
Fields Modifier and Type Field Description static ErrorHandlerDEFAULTdefault error handler used if none provided (just rethrows exception)
-
Method Summary
All Methods Instance Methods Abstract 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.
-
-
-
Field Detail
-
DEFAULT
static final ErrorHandler DEFAULT
default error handler used if none provided (just rethrows exception)- Usage:
- General: This field is general use.
-
-
Method Detail
-
handleRowError
Object handleRowError(Column column, byte[] columnData, ErrorHandler.Location location, Exception error) throws IOException
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).- 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
-
-