protected XMLStreamWriter _createXmlWriter(Writer w) throws IOException { XMLStreamWriter sw; try { sw = _xmlOutputFactory.createXMLStreamWriter(w); } catch (XMLStreamException e) { return StaxUtil.throwAsGenerationException(e, null); } return _initializeXmlWriter(sw); }
protected XMLStreamWriter _createXmlWriter(OutputStream out) throws IOException { XMLStreamWriter sw; try { sw = _xmlOutputFactory.createXMLStreamWriter(out, "UTF-8"); } catch (XMLStreamException e) { return StaxUtil.throwAsGenerationException(e, null); } return _initializeXmlWriter(sw); }
protected XMLStreamWriter _createXmlWriter(OutputStream out) throws IOException { try { return _initializeXmlWriter(_xmlOutputFactory.createXMLStreamWriter(out, "UTF-8")); } catch (XMLStreamException e) { return StaxUtil.throwXmlAsIOException(e); } }
protected XMLStreamWriter _createXmlWriter(Writer w) throws IOException { try { return _initializeXmlWriter(_xmlOutputFactory.createXMLStreamWriter(w)); } catch (XMLStreamException e) { return StaxUtil.throwXmlAsIOException(e); } }
/** * Factory method that wraps given {@link XMLStreamWriter}, usually to allow * incremental serialization to compose large output by serializing a sequence * of individual objects. * * @since 2.4 */ public ToXmlGenerator createGenerator(XMLStreamWriter sw) throws IOException { try { sw = _initializeXmlWriter(sw); } catch (XMLStreamException e) { return StaxUtil.throwXmlAsIOException(e); } IOContext ctxt = _createContext(sw, false); return new ToXmlGenerator(ctxt, _generatorFeatures, _xmlGeneratorFeatures, _objectCodec, sw); }
/** * Factory method that wraps given {@link XMLStreamWriter}, usually to allow * incremental serialization to compose large output by serializing a sequence * of individual objects. */ public ToXmlGenerator createGenerator(ObjectWriteContext writeCtxt, XMLStreamWriter sw) throws IOException { sw = _initializeXmlWriter(sw); IOContext ioCtxt = _createContext(sw, false); return new ToXmlGenerator(writeCtxt, ioCtxt, writeCtxt.getStreamWriteFeatures(_streamWriteFeatures), writeCtxt.getFormatWriteFeatures(_formatWriteFeatures), sw, _xmlPrettyPrinter(writeCtxt)); }