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 - XMLStreamExceptionFactoryConfigurationErrorOMOutputFormat.DEFAULT_CHAR_SET_ENCODINGpublic void writeStartElement(String string) throws XMLStreamException
writeStartElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeStartElement(String string, String string1) throws XMLStreamException
writeStartElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeStartElement(String string, String string1, String string2) throws XMLStreamException
writeStartElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeEmptyElement(String string, String string1) throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeEmptyElement(String string, String string1, String string2) throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeEmptyElement(String string) throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeEndElement()
throws XMLStreamException
writeEndElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeEndDocument()
throws XMLStreamException
writeEndDocument in interface XMLStreamWriterXMLStreamExceptionpublic void close()
throws XMLStreamException
close in interface XMLStreamWriterXMLStreamExceptionpublic void flush()
throws XMLStreamException
flush in interface XMLStreamWriterXMLStreamExceptionpublic void writeAttribute(String string, String string1) throws XMLStreamException
writeAttribute in interface XMLStreamWriterXMLStreamExceptionpublic void writeAttribute(String string, String string1, String string2, String string3) throws XMLStreamException
writeAttribute in interface XMLStreamWriterXMLStreamExceptionpublic void writeAttribute(String string, String string1, String string2) throws XMLStreamException
writeAttribute in interface XMLStreamWriterXMLStreamExceptionpublic void writeNamespace(String string, String string1) throws XMLStreamException
writeNamespace in interface XMLStreamWriterXMLStreamExceptionpublic void writeDefaultNamespace(String string) throws XMLStreamException
writeDefaultNamespace in interface XMLStreamWriterXMLStreamExceptionpublic void writeComment(String string) throws XMLStreamException
writeComment in interface XMLStreamWriterXMLStreamExceptionpublic void writeProcessingInstruction(String string) throws XMLStreamException
writeProcessingInstruction in interface XMLStreamWriterXMLStreamExceptionpublic void writeProcessingInstruction(String string, String string1) throws XMLStreamException
writeProcessingInstruction in interface XMLStreamWriterXMLStreamExceptionpublic void writeCData(String string) throws XMLStreamException
writeCData in interface XMLStreamWriterXMLStreamExceptionpublic void writeDTD(String string) throws XMLStreamException
writeDTD in interface XMLStreamWriterXMLStreamExceptionpublic void writeEntityRef(String string) throws XMLStreamException
writeEntityRef in interface XMLStreamWriterXMLStreamExceptionpublic void writeStartDocument()
throws XMLStreamException
writeStartDocument in interface XMLStreamWriterXMLStreamExceptionpublic void writeStartDocument(String string) throws XMLStreamException
writeStartDocument in interface XMLStreamWriterXMLStreamExceptionpublic void writeStartDocument(String string, String string1) throws XMLStreamException
writeStartDocument in interface XMLStreamWriterXMLStreamExceptionpublic void writeCharacters(String string) throws XMLStreamException
writeCharacters in interface XMLStreamWriterXMLStreamExceptionpublic void writeCharacters(char[] chars,
int i,
int i1)
throws XMLStreamException
writeCharacters in interface XMLStreamWriterXMLStreamExceptionpublic String getPrefix(String string) throws XMLStreamException
getPrefix in interface XMLStreamWriterXMLStreamExceptionpublic void setPrefix(String string, String string1) throws XMLStreamException
setPrefix in interface XMLStreamWriterXMLStreamExceptionpublic void setDefaultNamespace(String string) throws XMLStreamException
setDefaultNamespace in interface XMLStreamWriterXMLStreamExceptionpublic void setNamespaceContext(NamespaceContext namespaceContext) throws XMLStreamException
setNamespaceContext in interface XMLStreamWriterXMLStreamExceptionpublic NamespaceContext getNamespaceContext()
getNamespaceContext in interface XMLStreamWriterpublic Object getProperty(String string) throws IllegalArgumentException
getProperty in interface XMLStreamWriterIllegalArgumentExceptionpublic 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 accessibleXMLStreamExceptionpublic void setFilter(XMLStreamWriterFilter filter)
public XMLStreamWriterFilter removeFilter()
Copyright © 2004–2016 The Apache Software Foundation. All rights reserved.