use of com.fasterxml.jackson.databind.introspect.AnnotationCollector in project beam by apache.
the class PipelineOptionsFactory method createBeanProperty.
private static BeanProperty createBeanProperty(Method method) {
AnnotationCollector ac = AnnotationCollector.emptyCollector();
for (Annotation ann : method.getAnnotations()) {
ac = ac.addOrOverride(ann);
}
AnnotatedMethod annotatedMethod = new AnnotatedMethod(new TypeResolutionContext.Basic(MAPPER.getTypeFactory(), TypeBindings.emptyBindings()), method, ac.asAnnotationMap(), null);
BeanPropertyDefinition propDef = SimpleBeanPropertyDefinition.construct(MAPPER.getDeserializationConfig(), annotatedMethod);
JavaType type = MAPPER.constructType(method.getGenericReturnType());
try {
return new MethodProperty(propDef, type, MAPPER.getDeserializationConfig().findTypeDeserializer(type), annotatedMethod.getAllAnnotations(), annotatedMethod);
} catch (JsonMappingException e) {
throw new RuntimeException(e);
}
}
Aggregations