use of org.glassfish.jersey.jettison.JettisonMarshaller in project jersey by jersey.
the class JettisonJaxbElementProvider method writeTo.
@Override
protected final void writeTo(JAXBElement<?> t, MediaType mediaType, Charset c, Marshaller m, OutputStream entityStream) throws JAXBException {
JettisonMarshaller jsonMarshaller = JettisonJaxbContext.getJSONMarshaller(m);
if (isFormattedOutput()) {
jsonMarshaller.setProperty(JettisonMarshaller.FORMATTED, true);
}
jsonMarshaller.marshallToJSON(t, new OutputStreamWriter(entityStream, c));
}
use of org.glassfish.jersey.jettison.JettisonMarshaller in project jersey by jersey.
the class JettisonRootElementProvider method writeTo.
@Override
protected void writeTo(Object t, MediaType mediaType, Charset c, Marshaller m, OutputStream entityStream) throws JAXBException {
JettisonMarshaller jsonMarshaller = JettisonJaxbContext.getJSONMarshaller(m);
if (isFormattedOutput()) {
jsonMarshaller.setProperty(JettisonMarshaller.FORMATTED, true);
}
jsonMarshaller.marshallToJSON(t, new OutputStreamWriter(entityStream, c));
}
Aggregations