protected JsonDeserializer<Object> _findRootDeserializer(DeserializationConfig cfg, JavaType valueType)
throws JsonMappingException {
// Sanity check: must have actual type...
if (valueType == null) {
throw new JsonMappingException("No value type configured for ObjectReader");
}
// First: have we already seen it?
JsonDeserializer<Object> deser = _rootDeserializers.get(valueType);
if (deser != null) {
return deser;
}
// es-hadoop: findType with 2 args have been removed since 1.9 so this code compiles on 1.8 (which has the fallback method)
// es-hadoop: on 1.5 only the 2 args method exists, since 1.9 only the one with 3 args hence the if
// Nope: need to ask provider to resolve it
deser = _provider.findTypedValueDeserializer(cfg, valueType);
if (deser == null) { // can this happen?
throw new JsonMappingException("Can not find a deserializer for type " + valueType);
}
_rootDeserializers.put(valueType, deser);
return deser;
}