}
if (dbObject instanceof JacksonDBObject) {
return (T) ((JacksonDBObject) dbObject).getObject();
}
try {
return (T) objectMapper.readValue(new BsonObjectTraversingParser(this, dbObject), type);
} catch (JsonMappingException e) {
throw new MongoJsonMappingException(e);
} catch (IOException e) {
// This shouldn't happen
throw new MongoException("Unknown error occurred converting BSON to object", e);