@Override protected void writeToResult(Object o, HttpHeaders headers, Result result) throws Exception { try { Class<?> clazz = ClassUtils.getUserClass(o); Marshaller marshaller = createMarshaller(clazz); setCharset(headers.getContentType(), marshaller); marshaller.marshal(o, result); } catch (MarshalException ex) { throw ex; } catch (JAXBException ex) { throw new HttpMessageConversionException("Invalid JAXB setup: " + ex.getMessage(), ex); } }
@Override protected void writeToResult(Object o, HttpHeaders headers, Result result) throws Exception { try { Class<?> clazz = ClassUtils.getUserClass(o); Marshaller marshaller = createMarshaller(clazz); setCharset(headers.getContentType(), marshaller); marshaller.marshal(o, result); } catch (MarshalException ex) { throw ex; } catch (JAXBException ex) { throw new HttpMessageConversionException("Invalid JAXB setup: " + ex.getMessage(), ex); } }
@Override protected void writeToResult(Object o, HttpHeaders headers, Result result) throws IOException { try { Class<?> clazz = ClassUtils.getUserClass(o); Marshaller marshaller = createMarshaller(clazz); setCharset(headers.getContentType(), marshaller); marshaller.marshal(o, result); } catch (MarshalException ex) { throw new HttpMessageNotWritableException("Could not marshal [" + o + "]: " + ex.getMessage(), ex); } catch (JAXBException ex) { throw new HttpMessageConversionException("Invalid JAXB setup: " + ex.getMessage(), ex); } }
@Override protected void writeToResult(Object o, HttpHeaders headers, Result result) throws Exception { try { Class<?> clazz = ClassUtils.getUserClass(o); Marshaller marshaller = createMarshaller(clazz); setCharset(headers.getContentType(), marshaller); marshaller.marshal(o, result); } catch (MarshalException ex) { throw ex; } catch (JAXBException ex) { throw new HttpMessageConversionException("Invalid JAXB setup: " + ex.getMessage(), ex); } }