use of org.apache.axiom.core.stream.serializer.Serializer 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;
}
use of org.apache.axiom.core.stream.serializer.Serializer in project webservices-axiom by apache.
the class XMLStreamWriterHandler method processDocumentTypeDeclaration.
@Override
public void processDocumentTypeDeclaration(String rootName, String publicId, String systemId, String internalSubset) throws StreamException {
StringWriter sw = new StringWriter();
Serializer serializer = new Serializer(sw);
serializer.startFragment();
serializer.processDocumentTypeDeclaration(rootName, publicId, systemId, internalSubset);
serializer.completed();
try {
writer.writeDTD(sw.toString());
} catch (XMLStreamException ex) {
throw new StreamException(ex);
}
}
use of org.apache.axiom.core.stream.serializer.Serializer in project webservices-axiom by apache.
the class XmlHandlerContentHandler method startDTD.
public void startDTD(String name, String publicId, String systemId) throws SAXException {
dtdName = name;
dtdPublicId = publicId;
dtdSystemId = systemId;
internalSubset = new StringWriter();
internalSubsetSerializer = new Serializer(internalSubset);
}
Aggregations