Package org.apache.axiom.om.impl

Examples of org.apache.axiom.om.impl.MTOMXMLStreamWriter


        internalSerialize(writer, true, includeXMLDeclaration);

    }

    protected void internalSerialize(XMLStreamWriter writer2, boolean cache, boolean includeXMLDeclaration) throws XMLStreamException {
        MTOMXMLStreamWriter writer = (MTOMXMLStreamWriter) writer2;
        if (includeXMLDeclaration) {
            //Check whether the OMOutput char encoding and OMDocument char
            //encoding matches, if not use char encoding of OMOutput
            String outputCharEncoding = writer.getCharSetEncoding();
            if (outputCharEncoding == null || "".equals(outputCharEncoding)) {
                writer.getXmlStreamWriter().writeStartDocument(charSetEncoding,
                        xmlVersion);
            } else {
                writer.getXmlStreamWriter().writeStartDocument(outputCharEncoding,
                        xmlVersion);
            }
        }

        Iterator children = this.getChildren();
View Full Code Here


    }

    protected void internalSerialize(XMLStreamWriter writer2, boolean cache)
            throws XMLStreamException {

        MTOMXMLStreamWriter writer = (MTOMXMLStreamWriter) writer2;
        if (!writer.isIgnoreXMLDeclaration()) {
            String charSetEncoding = writer.getCharSetEncoding();
            String xmlVersion = writer.getXmlVersion();
            writer.getXmlStreamWriter().writeStartDocument(
                    charSetEncoding == null ? OMConstants.DEFAULT_CHAR_SET_ENCODING
                            : charSetEncoding,
                    xmlVersion == null ? OMConstants.DEFAULT_XML_VERSION
                            : xmlVersion);
        }
View Full Code Here

            writeOutput(writer2);
        } else {
            //check whether we have a MTOMXMLStreamWriter. if so
            //we can optimize the writing!
            if (writer2 instanceof MTOMXMLStreamWriter) {
                MTOMXMLStreamWriter writer = (MTOMXMLStreamWriter) writer2;
                if (writer.isOptimized()) {
                    if (contentID == null) {
                        contentID = writer.getNextContentId();
                    }
                    // send binary as MTOM optimised
                    this.attribute = new OMAttributeImpl("href",
                                                         new OMNamespaceImpl("", ""),
                                                         "cid:" + getContentID(), this.factory);
                    this.serializeStartpart(writer);
                    writer.writeOptimized(this);
                    writer.writeEndElement();
                } else {
                    //do normal base64
                    writeOutput(writer);
                }
            } else {
View Full Code Here

     *
     * @param output
     * @throws XMLStreamException
     */
    public void serializeAndConsume(OutputStream output) throws XMLStreamException {
        MTOMXMLStreamWriter writer = new MTOMXMLStreamWriter(output, new OMOutputFormat());
        internalSerializeAndConsume(writer);
        writer.flush();
    }
View Full Code Here

     *
     * @param output
     * @throws XMLStreamException
     */
    public void serialize(OutputStream output) throws XMLStreamException {
        MTOMXMLStreamWriter writer = new MTOMXMLStreamWriter(output, new OMOutputFormat());
        internalSerialize(writer);
        writer.flush();
    }
View Full Code Here

     * @param format
     * @throws XMLStreamException
     */
    public void serializeAndConsume(OutputStream output, OMOutputFormat format)
            throws XMLStreamException {
        MTOMXMLStreamWriter writer = new MTOMXMLStreamWriter(output, format);
        internalSerializeAndConsume(writer);
        writer.flush();
    }
View Full Code Here

     * @param output
     * @param format
     * @throws XMLStreamException
     */
    public void serialize(OutputStream output, OMOutputFormat format) throws XMLStreamException {
        MTOMXMLStreamWriter writer = new MTOMXMLStreamWriter(output, format);
        internalSerialize(writer);
        writer.flush();
    }
View Full Code Here

    }

    protected void internalSerialize(XMLStreamWriter writer2, boolean cache,
                                     boolean includeXMLDeclaration) throws XMLStreamException {
        MTOMXMLStreamWriter writer = (MTOMXMLStreamWriter) writer2;
        if (includeXMLDeclaration) {
            //Check whether the OMOutput char encoding and OMDocument char
            //encoding matches, if not use char encoding of OMOutput
            String outputCharEncoding = writer.getCharSetEncoding();
            if (outputCharEncoding == null || "".equals(outputCharEncoding)) {
                writer.getXmlStreamWriter().writeStartDocument(charSetEncoding,
                                                               xmlVersion);
            } else {
                writer.getXmlStreamWriter().writeStartDocument(outputCharEncoding,
                                                               xmlVersion);
            }
        }

        Iterator children = this.getChildren();
View Full Code Here

     * @param xmlWriter
     * @throws javax.xml.stream.XMLStreamException
     *
     */
    public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException {
        MTOMXMLStreamWriter writer = new MTOMXMLStreamWriter(xmlWriter);
        internalSerialize(writer);
        writer.flush();
    }
View Full Code Here

     * @param xmlWriter
     * @throws javax.xml.stream.XMLStreamException
     *
     */
    public void serializeAndConsume(XMLStreamWriter xmlWriter) throws XMLStreamException {
        MTOMXMLStreamWriter writer = new MTOMXMLStreamWriter(xmlWriter);
        internalSerializeAndConsume(writer);
        writer.flush();
    }
View Full Code Here

TOP

Related Classes of org.apache.axiom.om.impl.MTOMXMLStreamWriter

Copyright © 2018 www.massapicom. 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.