use of org.springframework.http.converter.HttpMessageConverter in project dhis2-core by dhis2.
the class MessageConverterAddingPostProcessor method postProcessAfterInitialization.
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
if (!(bean instanceof RequestMappingHandlerAdapter)) {
return bean;
}
RequestMappingHandlerAdapter handlerAdapter = (RequestMappingHandlerAdapter) bean;
List<HttpMessageConverter<?>> converters = handlerAdapter.getMessageConverters();
converters.add(0, messageConverter);
handlerAdapter.setMessageConverters(converters);
return handlerAdapter;
}
Aggregations