}
if (dbObject instanceof JacksonDBObject) {
return (T) ((JacksonDBObject) dbObject).getObject();
}
try {
return (T) objectMapper.readValue(new BsonObjectTraversingParser(
this, dbObject, objectMapper), type);
} catch (JsonMappingException e) {
throw new MongoJsonMappingException(e);
} catch (IOException e) {
// This shouldn't happen