protected XMLOutputFactory createOutputFactory() { return new WstxOutputFactory(); }
public XMLOutputFactory2 createOutputFactory() { return new WstxOutputFactory(); }
@Override protected XMLOutputFactory createOutputFactory() { return new WstxOutputFactory(); }
@Override public XMLOutputFactory2 createOutputFactory() { return new WstxOutputFactory(); }
@Override public XMLOutputFactory2 createOutputFactory() { return new WstxOutputFactory(); }
protected XMLOutputFactory createOutputFactory() { return new WstxOutputFactory(); }
@Override public XMLOutputFactory2 createOutputFactory() { return new WstxOutputFactory(); }
protected XMLOutputFactory createOutputFactory() { return new WstxOutputFactory(); }
public XMLOutputFactory2 createOutputFactory() { return new WstxOutputFactory(); }
protected XMLOutputFactory createOutputFactory() { return new WstxOutputFactory(); }
protected XMLOutputFactory createOutputFactory() { return new WstxOutputFactory(); }
protected XMLOutputFactory createOutputFactory() { return new WstxOutputFactory(); }
WstxOutputFactory factory = new WstxOutputFactory(); factory.setProperty(WstxOutputFactory.P_AUTOMATIC_EMPTY_ELEMENTS, true); SMOutputFactory outf = new SMOutputFactory(factory); doc = outf.createOutputDocument(fout); doc.setIndentation("\n ", 1, 1);
WstxOutputFactory factory = new WstxOutputFactory(); factory.setProperty(WstxOutputFactory.P_AUTOMATIC_EMPTY_ELEMENTS, true);
/** * * @param indent * @throws XMLStreamException */ public MathMLXMLStreamCompiler(String indent) throws XMLStreamException { // Explicitly creating WstxOutputFactory as it is needed by staxmate and it is then easier for // OSGi to find the needed dependencies WstxOutputFactory outputFactory = new WstxOutputFactory(); SMOutputFactory smFactory = new SMOutputFactory(outputFactory); writer = smFactory.createStax2Writer(new StringWriter()); this.indent = indent; }
/** * * @param xmlNode * @return * @throws XMLStreamException */ public static String toXML(XMLNode xmlNode) throws XMLStreamException { String xml = ""; StringWriter stream = new StringWriter(); // Explicitly creating WstxOutputFactory as it is needed by staxmate and it is then easier for // OSGi to find the needed dependencies WstxOutputFactory outputFactory = new WstxOutputFactory(); SMOutputFactory smFactory = new SMOutputFactory(outputFactory); XMLStreamWriter2 writer = smFactory.createStax2Writer(stream); // writer.writeCharacters("\n"); XMLNodeWriter xmlNodewriter = new XMLNodeWriter(writer, 0, 2, ' '); xmlNodewriter.write(xmlNode); writer.close(); xml = stream.toString(); return xml; }
WstxOutputFactory outputFactory = new WstxOutputFactory(); SMOutputFactory smFactory = new SMOutputFactory(outputFactory);
/** * Writes the {@link Annotation} of an {@link SBase} element to an XML {@link String}. * * @param sbase the {@link SBase} element. * @return the {@link Annotation} of the given {@link SBase} element as an XML {@link String}. * @throws XMLStreamException if any error occur while creating the XML document. */ public String writeAnnotation(SBase sbase) throws XMLStreamException { String annotationStr = ""; if ((sbase == null) || !sbase.isSetAnnotation()) { return annotationStr; } StringWriter stream = new StringWriter(); WstxOutputFactory outputFactory = new WstxOutputFactory(); SMOutputFactory smFactory = new SMOutputFactory(outputFactory); XMLStreamWriter2 writer = smFactory.createStax2Writer(stream); // Create an xml fragment to avoid having the xml declaration SMRootFragment outputDocument = SMOutputFactory.createOutputFragment(writer); // all the sbml element namespaces are registered to the writer in the writeAnnotation method // call the writeAnnotation, indicating that we are building an xml fragment writeAnnotation(sbase, outputDocument, writer, 0, true); writer.writeEndDocument(); writer.close(); annotationStr = stream.toString(); return annotationStr; }
WstxOutputFactory factory = new WstxOutputFactory(); SMOutputFactory smFactory = new SMOutputFactory(factory); XMLStreamWriter2 streamWriter = smFactory.createStax2Writer(stream);
/** * Creates a new {@link com.fasterxml.jackson.dataformat.xml.XmlMapper} using Woodstox * with Logback and Joda Time support. * Also includes all {@link io.dropwizard.jackson.Discoverable} interface implementations. * * @return XmlMapper */ public static XmlMapper newXMLMapper(JacksonXmlModule jacksonXmlModule) { final XmlFactory woodstoxFactory = new XmlFactory(new WstxInputFactory(), new WstxOutputFactory()); final XmlMapper mapper = new XmlMapper(woodstoxFactory, jacksonXmlModule); mapper.registerModule(new GuavaModule()); mapper.registerModule(new GuavaExtrasModule()); mapper.registerModule(new JodaModule()); mapper.registerModule(new FuzzyEnumModule()); mapper.setPropertyNamingStrategy(new AnnotationSensitivePropertyNamingStrategy()); mapper.setSubtypeResolver(new DiscoverableSubtypeResolver()); return mapper; } }