use of com.fasterxml.jackson.databind.deser.DefaultDeserializationContext in project beam by apache.
the class PipelineOptionsFactory method computeDeserializerForMethod.
private static JsonDeserializer<Object> computeDeserializerForMethod(Method method) {
try {
BeanProperty prop = createBeanProperty(method);
AnnotatedMember annotatedMethod = prop.getMember();
DefaultDeserializationContext context = DESERIALIZATION_CONTEXT.get();
Object maybeDeserializerClass = context.getAnnotationIntrospector().findDeserializer(annotatedMethod);
JsonDeserializer<Object> jsonDeserializer = context.deserializerInstance(annotatedMethod, maybeDeserializerClass);
if (jsonDeserializer == null) {
jsonDeserializer = context.findContextualValueDeserializer(prop.getType(), prop);
}
TypeDeserializer typeDeserializer = context.getFactory().findTypeDeserializer(context.getConfig(), prop.getType());
if (typeDeserializer != null) {
jsonDeserializer = new TypeWrappedDeserializer(typeDeserializer, jsonDeserializer);
}
return jsonDeserializer;
} catch (JsonMappingException e) {
throw new RuntimeException(e);
}
}
Aggregations