use of org.jdbi.v3.core.result.UnableToProduceResultException in project jdbi by jdbi.
the class JacksonJsonMapper method fromJson.
@Override
public Object fromJson(Type type, String json, ConfigRegistry config) {
try {
Jackson2Config cfg = config.get(Jackson2Config.class);
ObjectReader reader = cfg.getMapper().readerFor(cfg.getMapper().constructType(type));
Class<?> view = cfg.getDeserializationView();
if (view != null) {
reader = reader.withView(view);
}
return reader.readValue(json);
} catch (IOException e) {
throw new UnableToProduceResultException(e);
}
}
Aggregations