org.simpleflatmapper.map.error.LogFieldMapperErrorHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sfm-map Show documentation
Show all versions of sfm-map Show documentation
Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.
package org.simpleflatmapper.map.error;
import org.simpleflatmapper.converter.Context;
import org.simpleflatmapper.map.FieldMapperErrorHandler;
import org.simpleflatmapper.map.MappingException;
import java.util.logging.Level;
import java.util.logging.Logger;
public final class LogFieldMapperErrorHandler implements FieldMapperErrorHandler {
private final Logger logger = Logger.getLogger(getClass().getName());
@Override
public void errorMappingField(final K key, final Object source, final Object target,
final Exception error, final Context mappingContext) throws MappingException {
logger.log(Level.WARNING, "Error getting value from " + source, error);
}
}