public class MTOMXMLStreamWriter extends Object implements XMLStreamWriter
Constructor and Description |
---|
MTOMXMLStreamWriter(OutputStream outStream,
OMOutputFormat format)
Creates a new MTOMXMLStreamWriter with specified encoding.
|
MTOMXMLStreamWriter(XMLStreamWriter xmlWriter) |
public MTOMXMLStreamWriter(XMLStreamWriter xmlWriter)
public MTOMXMLStreamWriter(OutputStream outStream, OMOutputFormat format) throws XMLStreamException, FactoryConfigurationError
outStream
- format
- XMLStreamException
FactoryConfigurationError
OMOutputFormat.DEFAULT_CHAR_SET_ENCODING
public void writeStartElement(String string) throws XMLStreamException
writeStartElement
in interface XMLStreamWriter
XMLStreamException
public void writeStartElement(String string, String string1) throws XMLStreamException
writeStartElement
in interface XMLStreamWriter
XMLStreamException
public void writeStartElement(String string, String string1, String string2) throws XMLStreamException
writeStartElement
in interface XMLStreamWriter
XMLStreamException
public void writeEmptyElement(String string, String string1) throws XMLStreamException
writeEmptyElement
in interface XMLStreamWriter
XMLStreamException
public void writeEmptyElement(String string, String string1, String string2) throws XMLStreamException
writeEmptyElement
in interface XMLStreamWriter
XMLStreamException
public void writeEmptyElement(String string) throws XMLStreamException
writeEmptyElement
in interface XMLStreamWriter
XMLStreamException
public void writeEndElement() throws XMLStreamException
writeEndElement
in interface XMLStreamWriter
XMLStreamException
public void writeEndDocument() throws XMLStreamException
writeEndDocument
in interface XMLStreamWriter
XMLStreamException
public void close() throws XMLStreamException
close
in interface XMLStreamWriter
XMLStreamException
public void flush() throws XMLStreamException
flush
in interface XMLStreamWriter
XMLStreamException
public void writeAttribute(String string, String string1) throws XMLStreamException
writeAttribute
in interface XMLStreamWriter
XMLStreamException
public void writeAttribute(String string, String string1, String string2, String string3) throws XMLStreamException
writeAttribute
in interface XMLStreamWriter
XMLStreamException
public void writeAttribute(String string, String string1, String string2) throws XMLStreamException
writeAttribute
in interface XMLStreamWriter
XMLStreamException
public void writeNamespace(String string, String string1) throws XMLStreamException
writeNamespace
in interface XMLStreamWriter
XMLStreamException
public void writeDefaultNamespace(String string) throws XMLStreamException
writeDefaultNamespace
in interface XMLStreamWriter
XMLStreamException
public void writeComment(String string) throws XMLStreamException
writeComment
in interface XMLStreamWriter
XMLStreamException
public void writeProcessingInstruction(String string) throws XMLStreamException
writeProcessingInstruction
in interface XMLStreamWriter
XMLStreamException
public void writeProcessingInstruction(String string, String string1) throws XMLStreamException
writeProcessingInstruction
in interface XMLStreamWriter
XMLStreamException
public void writeCData(String string) throws XMLStreamException
writeCData
in interface XMLStreamWriter
XMLStreamException
public void writeDTD(String string) throws XMLStreamException
writeDTD
in interface XMLStreamWriter
XMLStreamException
public void writeEntityRef(String string) throws XMLStreamException
writeEntityRef
in interface XMLStreamWriter
XMLStreamException
public void writeStartDocument() throws XMLStreamException
writeStartDocument
in interface XMLStreamWriter
XMLStreamException
public void writeStartDocument(String string) throws XMLStreamException
writeStartDocument
in interface XMLStreamWriter
XMLStreamException
public void writeStartDocument(String string, String string1) throws XMLStreamException
writeStartDocument
in interface XMLStreamWriter
XMLStreamException
public void writeCharacters(String string) throws XMLStreamException
writeCharacters
in interface XMLStreamWriter
XMLStreamException
public void writeCharacters(char[] chars, int i, int i1) throws XMLStreamException
writeCharacters
in interface XMLStreamWriter
XMLStreamException
public String getPrefix(String string) throws XMLStreamException
getPrefix
in interface XMLStreamWriter
XMLStreamException
public void setPrefix(String string, String string1) throws XMLStreamException
setPrefix
in interface XMLStreamWriter
XMLStreamException
public void setDefaultNamespace(String string) throws XMLStreamException
setDefaultNamespace
in interface XMLStreamWriter
XMLStreamException
public void setNamespaceContext(NamespaceContext namespaceContext) throws XMLStreamException
setNamespaceContext
in interface XMLStreamWriter
XMLStreamException
public NamespaceContext getNamespaceContext()
getNamespaceContext
in interface XMLStreamWriter
public Object getProperty(String string) throws IllegalArgumentException
getProperty
in interface XMLStreamWriter
IllegalArgumentException
public boolean isOptimized()
XMLStreamWriterUtils.writeDataHandler(XMLStreamWriter, DataHandler, String, boolean)
or XMLStreamWriterUtils.writeDataHandler(XMLStreamWriter, org.apache.axiom.ext.stax.datahandler.DataHandlerProvider, String, boolean)
to submit any binary content and let this writer decide whether the content should be
written as base64 encoded character data or using xop:Include.
This makes optimization entirely transparent for the caller and there should be no need
to check if the writer is producing MTOM.public String getContentType()
public void writeOptimized(OMText node)
XMLStreamWriterUtils.writeDataHandler(XMLStreamWriter, DataHandler, String, boolean)
or XMLStreamWriterUtils.writeDataHandler(XMLStreamWriter, org.apache.axiom.ext.stax.datahandler.DataHandlerProvider, String, boolean)
to submit any binary content and let this writer decide whether the content should be
written as base64 encoded character data or using xop:Include.public boolean isOptimizedThreshold(OMText node)
XMLStreamWriterUtils.writeDataHandler(XMLStreamWriter, DataHandler, String, boolean)
or XMLStreamWriterUtils.writeDataHandler(XMLStreamWriter, org.apache.axiom.ext.stax.datahandler.DataHandlerProvider, String, boolean)
to submit any binary content and let this writer decide whether the content should be
written as base64 encoded character data or using xop:Include.
Since the writer applies the settings defined in OMOutputFormat
(including MTOM
thresholds), there is not need for this method anymore.public void setXmlStreamWriter(XMLStreamWriter xmlWriter)
public XMLStreamWriter getXmlStreamWriter()
public String getMimeBoundary()
public String getRootContentId()
public String getNextContentId()
public String getCharSetEncoding()
public void setCharSetEncoding(String charSetEncoding)
public String getXmlVersion()
public void setXmlVersion(String xmlVersion)
public void setSoap11(boolean b)
public boolean isIgnoreXMLDeclaration()
public void setIgnoreXMLDeclaration(boolean ignoreXMLDeclaration)
public void setDoOptimize(boolean b)
public OMOutputFormat getOutputFormat()
The caller should use the returned instance in a read-only way, i.e. he should not modify the settings of the output format. Any attempt to do so will lead to unpredictable results.
public void setOutputFormat(OMOutputFormat format)
public OutputStream getOutputStream() throws XMLStreamException
OutputStream
for this writer, if available. This method allows a
node (perhaps an OMSourcedElement
) to write its content directly
to the byte stream.
WARNING: This method should be used with extreme care. The caller must be prepared to handle the following issues:
null
if the stream is not accessibleXMLStreamException
public void setFilter(XMLStreamWriterFilter filter)
public XMLStreamWriterFilter removeFilter()
Copyright © 2004–2018 The Apache Software Foundation. All rights reserved.