Examples of StAXSerializer


Examples of org.apache.axiom.om.impl.common.serializer.push.stax.StAXSerializer

    }

    public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException {
        // The contract is to serialize with caching
        try {
            internalSerialize(new StAXSerializer(this, xmlWriter), new OMOutputFormat(), true);
        } catch (OutputException ex) {
            throw (XMLStreamException)ex.getCause();
        }
    }
View Full Code Here

Examples of org.apache.axiom.om.impl.common.serializer.push.stax.StAXSerializer

    }

    public void serializeAndConsume(javax.xml.stream.XMLStreamWriter xmlWriter)
            throws XMLStreamException {
        try {
            internalSerialize(new StAXSerializer(this, xmlWriter), new OMOutputFormat(), false);
        } catch (OutputException ex) {
            throw (XMLStreamException)ex.getCause();
        }
    }
View Full Code Here

Examples of org.apache.axiom.om.impl.common.serializer.push.stax.StAXSerializer

        // If the input xmlWriter is not an MTOMXMLStreamWriter, then wrapper it
        MTOMXMLStreamWriter writer = xmlWriter instanceof MTOMXMLStreamWriter ?
                (MTOMXMLStreamWriter) xmlWriter :
                    new MTOMXMLStreamWriter(xmlWriter);
        try {
            internalSerialize(new StAXSerializer(this, writer), writer.getOutputFormat(), cache);
        } catch (OutputException ex) {
            throw (XMLStreamException)ex.getCause();
        }
        writer.flush();
    }
View Full Code Here

Examples of org.apache.axiom.om.impl.common.serializer.push.stax.StAXSerializer

    public void serialize(OutputStream output, OMOutputFormat format) throws XMLStreamException {
        MTOMXMLStreamWriter writer = new MTOMXMLStreamWriter(output, format, true);
        try {
            try {
                internalSerialize(new StAXSerializer(this, writer), format, true);
            } catch (OutputException ex) {
                throw (XMLStreamException)ex.getCause();
            }
            // TODO: the flush is necessary because of an issue with the lifecycle of MTOMXMLStreamWriter
            writer.flush();
View Full Code Here

Examples of org.apache.axiom.om.impl.common.serializer.push.stax.StAXSerializer

        MTOMXMLStreamWriter writer =
                new MTOMXMLStreamWriter(StAXUtils.createXMLStreamWriter(writer2));
        writer.setOutputFormat(format);
        try {
            try {
                internalSerialize(new StAXSerializer(this, writer), format, true);
            } catch (OutputException ex) {
                throw (XMLStreamException)ex.getCause();
            }
            // TODO: the flush is necessary because of an issue with the lifecycle of MTOMXMLStreamWriter
            writer.flush();
View Full Code Here

Examples of org.apache.axiom.om.impl.common.serializer.push.stax.StAXSerializer

    public void serializeAndConsume(OutputStream output, OMOutputFormat format)
            throws XMLStreamException {
        MTOMXMLStreamWriter writer = new MTOMXMLStreamWriter(output, format, false);
        try {
            try {
                internalSerialize(new StAXSerializer(this, writer), format, false);
            } catch (OutputException ex) {
                throw (XMLStreamException)ex.getCause();
            }
            // TODO: the flush is necessary because of an issue with the lifecycle of MTOMXMLStreamWriter
            writer.flush();
View Full Code Here

Examples of org.apache.axiom.om.impl.common.serializer.push.stax.StAXSerializer

        MTOMXMLStreamWriter writer =
                new MTOMXMLStreamWriter(StAXUtils.createXMLStreamWriter(writer2));
        writer.setOutputFormat(format);
        try {
            try {
                internalSerialize(new StAXSerializer(this, writer), format, false);
            } catch (OutputException ex) {
                throw (XMLStreamException)ex.getCause();
            }
            // TODO: the flush is necessary because of an issue with the lifecycle of MTOMXMLStreamWriter
            writer.flush();
View Full Code Here

Examples of org.codehaus.xfire.util.jdom.StaxSerializer

                    try {
                        Method mth = exceptions[i].getMethod("getFaultInfo");
                        Class<?> infoClass = mth.getReturnType();
                        ByteArrayOutputStream baos = new ByteArrayOutputStream();
                        XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(baos);
                        new StaxSerializer().writeElement(detail, writer);
                        writer.close();
                        ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
                        JAXBElement<?> obj = JAXBContext.newInstance(infoClass).createUnmarshaller()
                                .unmarshal(new StreamSource(bais), infoClass);
                        Constructor<?> cst = exceptions[i].getConstructor(String.class, infoClass);
View Full Code Here

Examples of org.codehaus.xfire.util.jdom.StaxSerializer

    public void writeMessage(OutMessage message, XMLStreamWriter writer, MessageContext context) throws XFireFault {
        try {
            XFireFault fault = (XFireFault) message.getBody();
            if (fault.hasDetails()) {
                Element detail = fault.getDetail();
                StaxSerializer serializer = new StaxSerializer();
                List details = detail.getContent();
                for (int i = 0; i < details.size(); i++) {
                    serializer.writeElement((Element) details.get(i), writer);
                }
            } else {
                writer.writeStartElement("stack");
                StringWriter sw = new StringWriter();
                PrintWriter pw = new PrintWriter(sw);
View Full Code Here

Examples of org.codehaus.xfire.util.jdom.StaxSerializer

            writer.writeCharacters(fault.getMessage());
            writer.writeEndElement(); // message
            if (fault.hasDetails()) {
                Element detail = fault.getDetail();
                writer.writeStartElement("detail");
                StaxSerializer serializer = new StaxSerializer();
                List details = detail.getContent();
                for (int i = 0; i < details.size(); i++) {
                    serializer.writeElement((Element) details.get(i), writer);
                }
                writer.writeEndElement(); // detail
            }
            if (configuration.isPrintStackTraceInFaults()) {
                writer.writeStartElement("stack");
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.