@Override public void handlerError(Throwable t, Object target) { ErrorHelper.rethrow(t); } }
@Override public Object apply(Object o) { try { return buildMethod.invoke(null, o); } catch (Exception e) { return ErrorHelper.rethrow(e); } } }
@Override public String apply(ResultSet in) { try { return column + ":" + in.getObject(column); } catch (SQLException e) { return ErrorHelper.rethrow(e); } } },
@SuppressWarnings("unchecked") @Override public T newInstance(S s) throws Exception { try { return (T) method.invoke(declaringClass); } catch(InvocationTargetException e) { return ErrorHelper.rethrow(e.getCause()); } }
@Override public boolean test(ROW row) { for(K k : keys) { try { if (keySourceGetter.getValue(k, row) == null) return false; } catch (Exception e) { ErrorHelper.rethrow(e); } } return true; } };
@Override public T apply(S s, Context mappingContext) { try { return fieldMapperGetter.get(s, mappingContext); } catch (Exception e) { return ErrorHelper.rethrow(e); } }
@Override public Double apply(S s, MappingContext<?> mappingContext) { try { return pGetter.getDouble(s, mappingContext); } catch (Exception e) { return ErrorHelper.rethrow(e); } } }
@Override public void accept(T t) { try { consumer.accept(t); } catch (Exception e) { ErrorHelper.rethrow(e); } } };
@Override public P map(S source, MappingContext<? super S> context) throws MappingException { try { return getter.get(source, context); } catch (Exception e) { return ErrorHelper.rethrow(e); } }
@SuppressWarnings("unchecked") @Override public T newInstance(S s) throws Exception { try { return (T) method.invoke(declaringClass, argBuilder.build(s)); } catch(InvocationTargetException e) { return ErrorHelper.rethrow(e.getCause()); } }
@Override public T newInstance(S1 s1, S2 s2) throws Exception { try { Object[] args = argBuilder.build(s1, s2); return constructor.newInstance(args); } catch(InvocationTargetException e) { return ErrorHelper.rethrow(e.getCause()); } }
@Override public void set(PreparedStatement ps, P value, int columnIndex, Context context) throws SQLException { try { setter.set(ps, getter.get(value), columnIndex, context); } catch (Exception e) { ErrorHelper.rethrow(e); } } }
@Override public int getSize(T value) { try { return sizeGetter.getInt(collectionGetter.get(value)); } catch (Exception e) { ErrorHelper.rethrow(e); return 1; } } }
@Override public T map(ROW row) throws MappingException { try { return getMapperFromRow(row).map(row); } catch(Exception e) { return ErrorHelper.rethrow(e); } }
@Override public void set(PreparedStatement target, I value, int columnIndex, Context context) throws SQLException { try { setter.set(target, converter.convert(value, context), columnIndex, context); } catch (Exception e) { ErrorHelper.rethrow(e); } } }
@Override public void bindTo(T value, PreparedStatement ps) throws SQLException { try { queryPreparer.mapper().mapTo(value, ps, null); } catch (Exception e) { ErrorHelper.rethrow(e); } } }
@Override public int getSize(T value) { try { return sizeGetter.getInt(collectionGetter.get(value)); } catch (Exception e) { ErrorHelper.rethrow(e); return 1; } } }
@Override public final T map(ROW row) throws MappingException { try { return getMapperFromRow(row).map(row); } catch(Exception e) { ErrorHelper.rethrow(e); return null; } }
@Override public boolean tryAdvance(Consumer<? super Row> action) { try { if (headers == null) { headers = headers(reader); } return reader.parseRow(new CellConsumerFixLengthToCheckConsumer(headers.size(), values -> action.accept(new Row(headers, values)))); } catch (IOException e) { return ErrorHelper.rethrow(e); } }
@Override public DbObject map(Object[] source, MappingContext<? super Object[]> context) throws MappingException { DbObject dbObject = new DbObject(); try { mapTo(source, dbObject, null); } catch (Exception e) { ErrorHelper.rethrow(e); } return dbObject; }