private void reorderXmlConvertersToEnd(List<HttpMessageConverter<?>> converters) { List<HttpMessageConverter<?>> xml = new ArrayList<HttpMessageConverter<?>>(); for (Iterator<HttpMessageConverter<?>> iterator = converters.iterator(); iterator .hasNext();) { HttpMessageConverter<?> converter = iterator.next(); if ((converter instanceof AbstractXmlHttpMessageConverter) || (converter instanceof MappingJackson2XmlHttpMessageConverter)) { xml.add(converter); iterator.remove(); } } converters.addAll(xml); }
@Override public boolean supports(MethodParameter returnType, Class<? extends HttpMessageConverter<?>> converterType) { return AbstractXmlHttpMessageConverter.class.isAssignableFrom(converterType) && WxMessage.class.isAssignableFrom(returnType.getParameterType()); }