Exemplo n.º 1
0
  public void marshal(T object, boolean formatted, OutputStream outputStream)
      throws XMLStreamException, JAXBException, TransformerException, JSONException {
    Configuration writeConfig = new Configuration(xmlNamespaceToJsonPrefix);
    MappedXMLOutputFactory xof = new MappedXMLOutputFactory(writeConfig);

    XMLStreamWriter xmlStreamWriter = xof.createXMLStreamWriter(outputStream);

    JaxbHelper jaxbHelper = JaxbHelper.get(clazz);
    jaxbHelper.marshal(object, formatted, xmlStreamWriter);
  }
Exemplo n.º 2
0
 public static XMLStreamWriter buildStreamWriter(Writer writer, Configuration configuration)
     throws XMLStreamException {
   MappedXMLOutputFactory xof = new MappedXMLOutputFactory(configuration);
   XMLStreamWriter xmlStreamWriter = xof.createXMLStreamWriter(writer);
   return xmlStreamWriter;
 }