Examples of StAXWriter


Examples of com.thoughtworks.xstream.io.xml.StaxWriter

        updateCharactorEncodingInfo(exchange);
        if (getXstreamDriver() != null) {
            return getXstreamDriver().createWriter(stream);
        }
        XMLStreamWriter xmlWriter = getStaxConverter().createXMLStreamWriter(stream, exchange);
        return new StaxWriter(new QNameMap(), xmlWriter);
    }
View Full Code Here

Examples of com.thoughtworks.xstream.io.xml.StaxWriter

        xs.setMode(XStream.NO_REFERENCES);
        return xs;
    }

    protected HierarchicalStreamWriter createHierarchicalStreamWriter(Exchange exchange, Object body, OutputStream stream) throws XMLStreamException {       
        return new StaxWriter(new QNameMap(), mof.createXMLStreamWriter(stream));
    }
View Full Code Here

Examples of com.thoughtworks.xstream.io.xml.StaxWriter

        @Override
        public StaxWriter createStaxWriter(XMLStreamWriter out, boolean writeStartEndDocument)
                throws XMLStreamException {

            return new StaxWriter(qnameMap, out, writeStartEndDocument, isRepairingNamespace(),
                    xmlFriendlyReplacer()) {

                private int indentLevel = 0;

                @Override
View Full Code Here

Examples of org.jibx.runtime.impl.StAXWriter

        IMarshallingContext mctx = bfact.createMarshallingContext();
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        try {
            XMLOutputFactory ofact = XMLOutputFactory.newInstance();
            XMLStreamWriter wrtr = ofact.createXMLStreamWriter(bos, enc);
            mctx.setXmlWriter(new StAXWriter(bfact.getNamespaces(), wrtr));
            mctx.marshalDocument(obj);
        } catch (XMLStreamException e) {
            throw new JiBXException("Error creating writer", e);
        }
       
View Full Code Here

Examples of org.jibx.runtime.impl.StAXWriter

        IMarshallingContext mctx = bfact.createMarshallingContext();
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        try {
            XMLOutputFactory ofact = XMLOutputFactory.newInstance();
            XMLStreamWriter wrtr = ofact.createXMLStreamWriter(bos, enc);
            mctx.setXmlWriter(new StAXWriter(bfact.getNamespaces(), wrtr));
            mctx.marshalDocument(obj);
        } catch (XMLStreamException e) {
            throw new JiBXException("Error creating writer", e);
        }
       
View Full Code Here

Examples of org.jibx.runtime.impl.StAXWriter

        IMarshallingContext mctx = obf.createMarshallingContext();
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        try {
            XMLOutputFactory ofact = XMLOutputFactory.newInstance();
            XMLStreamWriter wrtr = ofact.createXMLStreamWriter(bos, "UTF-8");
            mctx.setXmlWriter(new StAXWriter(obf.getNamespaces(), wrtr));
            mctx.marshalDocument(obj);
        } catch (XMLStreamException e) {
            throw new JiBXException("Error creating writer", e);
        }
       
View Full Code Here

Examples of org.jibx.runtime.impl.StAXWriter

        {
            IMarshallingContext mctx = bfact.createMarshallingContext();

            XMLStreamWriter noCloseWriter = new NoCloseXMLStreamWriter(((ElementWriter) writer)
                    .getXMLStreamWriter());
            mctx.setXmlWriter(new StAXWriter(bfact.getNamespaces(), noCloseWriter));

            mctx.marshalDocument(object);
        }
        catch (JiBXException e)
        {
View Full Code Here

Examples of org.jibx.runtime.impl.StAXWriter

    /* (non-Javadoc)
     * @see org.apache.axiom.om.OMDataSource#serialize(javax.xml.stream.XMLStreamWriter)
     */
    public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException {
        try {
            IXMLWriter writer = new StAXWriter(bindingFactory.getNamespaces(),
                xmlWriter);
            IMarshallingContext ctx = bindingFactory.createMarshallingContext();
            ctx.setXmlWriter(writer);
            marshal(ctx);
        } catch (JiBXException e) {
View Full Code Here

Examples of org.jibx.runtime.impl.StAXWriter

            }
        } else {
            try {
                IBindingFactory factory = BindingDirectory.getFactory(obj.getClass());
                IMarshallingContext ctx = getMarshallingContext(obj);
                StAXWriter writer = new StAXWriter(factory.getNamespaces(), output);
                ctx.setXmlWriter(writer);
                ((IMarshallable)obj).marshal(ctx);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
View Full Code Here

Examples of org.jibx.runtime.impl.StAXWriter

                    }
                }
            }
           
            // marshal with all namespace declarations, since external state unknown
            IXMLWriter writer = new StAXWriter(nss, xmlWriter);
            IMarshallingContext ctx = bindingFactory.createMarshallingContext();
            ctx.setXmlWriter(writer);
            marshal(full, ctx);
           
        } catch (JiBXException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.