use of org.apache.axiom.core.stream.NamespaceRepairingFilterHandler 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;
}
Aggregations