Search in sources :

Example 1 with XOPEncodingFilterHandler

use of org.apache.axiom.om.impl.stream.xop.XOPEncodingFilterHandler in project webservices-axiom by apache.

the class MTOMXMLStreamWriterImpl method getOutputStream.

@Override
public OutputStream getOutputStream() throws XMLStreamException {
    OutputStream outputStream;
    XmlHandler handler = getHandler();
    // Remove wrappers that can be safely removed
    while (handler instanceof DocumentElementExtractingFilterHandler || handler instanceof NamespaceRepairingFilterHandler || handler instanceof XsiTypeFilterHandler || handler instanceof XmlDeclarationRewriterHandler || handler instanceof XOPEncodingFilterHandler) {
        handler = ((XmlHandlerWrapper) handler).getParent();
    }
    if (handler instanceof Serializer) {
        try {
            outputStream = ((Serializer) handler).getOutputStream();
        } catch (StreamException ex) {
            throw new XMLStreamException(ex);
        }
    } else {
        outputStream = null;
    }
    if (log.isDebugEnabled()) {
        if (outputStream == null) {
            log.debug("Direct access to the output stream is not available.");
        } else {
            log.debug("Returning access to the output stream: " + outputStream);
        }
    }
    return outputStream;
}
Also used : NamespaceRepairingFilterHandler(org.apache.axiom.core.stream.NamespaceRepairingFilterHandler) XMLStreamException(javax.xml.stream.XMLStreamException) XmlHandler(org.apache.axiom.core.stream.XmlHandler) DocumentElementExtractingFilterHandler(org.apache.axiom.core.stream.DocumentElementExtractingFilterHandler) XsiTypeFilterHandler(org.apache.axiom.om.impl.stream.XsiTypeFilterHandler) OutputStream(java.io.OutputStream) XmlDeclarationRewriterHandler(org.apache.axiom.om.impl.stream.XmlDeclarationRewriterHandler) XOPEncodingFilterHandler(org.apache.axiom.om.impl.stream.xop.XOPEncodingFilterHandler) Serializer(org.apache.axiom.core.stream.serializer.Serializer) StreamException(org.apache.axiom.core.stream.StreamException) XMLStreamException(javax.xml.stream.XMLStreamException)

Aggregations

OutputStream (java.io.OutputStream)1 XMLStreamException (javax.xml.stream.XMLStreamException)1 DocumentElementExtractingFilterHandler (org.apache.axiom.core.stream.DocumentElementExtractingFilterHandler)1 NamespaceRepairingFilterHandler (org.apache.axiom.core.stream.NamespaceRepairingFilterHandler)1 StreamException (org.apache.axiom.core.stream.StreamException)1 XmlHandler (org.apache.axiom.core.stream.XmlHandler)1 Serializer (org.apache.axiom.core.stream.serializer.Serializer)1 XmlDeclarationRewriterHandler (org.apache.axiom.om.impl.stream.XmlDeclarationRewriterHandler)1 XsiTypeFilterHandler (org.apache.axiom.om.impl.stream.XsiTypeFilterHandler)1 XOPEncodingFilterHandler (org.apache.axiom.om.impl.stream.xop.XOPEncodingFilterHandler)1