@Override public void setOutput(OutputStream outputStream) throws Exception { this.out = outputStream; XMLOutputFactory factory = XMLOutputFactory.newInstance(); XMLStreamWriter rawXmlWriter = factory.createXMLStreamWriter(outputStream, "UTF-8"); XmlDataExporter.PrettyPrintHandler handler = new XmlDataExporter.PrettyPrintHandler(rawXmlWriter); XMLStreamWriter xmlWriter = (XMLStreamWriter) Proxy.newProxyInstance(XMLStreamWriter.class.getClassLoader(), new Class[]{XMLStreamWriter.class}, handler); this.writer = new XMLMessageExporter(xmlWriter); }
@Override public void setOutput(OutputStream outputStream) throws Exception { this.out = outputStream; XMLOutputFactory factory = XMLOutputFactory.newInstance(); XMLStreamWriter rawXmlWriter = factory.createXMLStreamWriter(outputStream, "UTF-8"); XmlDataExporter.PrettyPrintHandler handler = new XmlDataExporter.PrettyPrintHandler(rawXmlWriter); XMLStreamWriter xmlWriter = (XMLStreamWriter) Proxy.newProxyInstance(XMLStreamWriter.class.getClassLoader(), new Class[]{XMLStreamWriter.class}, handler); this.writer = new XMLMessageExporter(xmlWriter); }
protected void writeOutput(OutputStream out) throws Exception { XMLOutputFactory factory = XMLOutputFactory.newInstance(); XMLStreamWriter rawXmlWriter = factory.createXMLStreamWriter(out, "UTF-8"); PrettyPrintHandler handler = new PrettyPrintHandler(rawXmlWriter); xmlWriter = (XMLStreamWriter) Proxy.newProxyInstance(XMLStreamWriter.class.getClassLoader(), new Class[]{XMLStreamWriter.class}, handler); exporter = new XMLMessageExporter(xmlWriter); writeXMLData(); }
protected void writeOutput(OutputStream out) throws Exception { XMLOutputFactory factory = XMLOutputFactory.newInstance(); XMLStreamWriter rawXmlWriter = factory.createXMLStreamWriter(out, "UTF-8"); PrettyPrintHandler handler = new PrettyPrintHandler(rawXmlWriter); xmlWriter = (XMLStreamWriter) Proxy.newProxyInstance(XMLStreamWriter.class.getClassLoader(), new Class[]{XMLStreamWriter.class}, handler); exporter = new XMLMessageExporter(xmlWriter); writeXMLData(); }