public class MTOMXMLStreamWriter extends Object implements javax.xml.stream.XMLStreamWriter
Constructor and Description |
---|
MTOMXMLStreamWriter(OutputStream outStream,
OMOutputFormat format)
Creates a new MTOMXMLStreamWriter with specified encoding.
|
MTOMXMLStreamWriter(javax.xml.stream.XMLStreamWriter xmlWriter) |
public MTOMXMLStreamWriter(javax.xml.stream.XMLStreamWriter xmlWriter)
public MTOMXMLStreamWriter(OutputStream outStream, OMOutputFormat format) throws javax.xml.stream.XMLStreamException, javax.xml.stream.FactoryConfigurationError
outStream
- format
- javax.xml.stream.XMLStreamException
javax.xml.stream.FactoryConfigurationError
OMOutputFormat.DEFAULT_CHAR_SET_ENCODING
public void writeStartElement(String string) throws javax.xml.stream.XMLStreamException
writeStartElement
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void writeStartElement(String string, String string1) throws javax.xml.stream.XMLStreamException
writeStartElement
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void writeStartElement(String string, String string1, String string2) throws javax.xml.stream.XMLStreamException
writeStartElement
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void writeEmptyElement(String string, String string1) throws javax.xml.stream.XMLStreamException
writeEmptyElement
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void writeEmptyElement(String string, String string1, String string2) throws javax.xml.stream.XMLStreamException
writeEmptyElement
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void writeEmptyElement(String string) throws javax.xml.stream.XMLStreamException
writeEmptyElement
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void writeEndElement() throws javax.xml.stream.XMLStreamException
writeEndElement
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void writeEndDocument() throws javax.xml.stream.XMLStreamException
writeEndDocument
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void close() throws javax.xml.stream.XMLStreamException
close
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void flush() throws javax.xml.stream.XMLStreamException
flush
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void writeAttribute(String string, String string1) throws javax.xml.stream.XMLStreamException
writeAttribute
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void writeAttribute(String string, String string1, String string2, String string3) throws javax.xml.stream.XMLStreamException
writeAttribute
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void writeAttribute(String string, String string1, String string2) throws javax.xml.stream.XMLStreamException
writeAttribute
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void writeNamespace(String string, String string1) throws javax.xml.stream.XMLStreamException
writeNamespace
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void writeDefaultNamespace(String string) throws javax.xml.stream.XMLStreamException
writeDefaultNamespace
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void writeComment(String string) throws javax.xml.stream.XMLStreamException
writeComment
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void writeProcessingInstruction(String string) throws javax.xml.stream.XMLStreamException
writeProcessingInstruction
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void writeProcessingInstruction(String string, String string1) throws javax.xml.stream.XMLStreamException
writeProcessingInstruction
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void writeCData(String string) throws javax.xml.stream.XMLStreamException
writeCData
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void writeDTD(String string) throws javax.xml.stream.XMLStreamException
writeDTD
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void writeEntityRef(String string) throws javax.xml.stream.XMLStreamException
writeEntityRef
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void writeStartDocument() throws javax.xml.stream.XMLStreamException
writeStartDocument
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void writeStartDocument(String string) throws javax.xml.stream.XMLStreamException
writeStartDocument
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void writeStartDocument(String string, String string1) throws javax.xml.stream.XMLStreamException
writeStartDocument
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void writeCharacters(String string) throws javax.xml.stream.XMLStreamException
writeCharacters
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void writeCharacters(char[] chars, int i, int i1) throws javax.xml.stream.XMLStreamException
writeCharacters
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public String getPrefix(String string) throws javax.xml.stream.XMLStreamException
getPrefix
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void setPrefix(String string, String string1) throws javax.xml.stream.XMLStreamException
setPrefix
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void setDefaultNamespace(String string) throws javax.xml.stream.XMLStreamException
setDefaultNamespace
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public void setNamespaceContext(NamespaceContext namespaceContext) throws javax.xml.stream.XMLStreamException
setNamespaceContext
in interface javax.xml.stream.XMLStreamWriter
javax.xml.stream.XMLStreamException
public NamespaceContext getNamespaceContext()
getNamespaceContext
in interface javax.xml.stream.XMLStreamWriter
public Object getProperty(String string) throws IllegalArgumentException
getProperty
in interface javax.xml.stream.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(javax.xml.stream.XMLStreamWriter xmlWriter)
public javax.xml.stream.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 javax.xml.stream.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 accessiblejavax.xml.stream.XMLStreamException
public void setFilter(XMLStreamWriterFilter filter)
public XMLStreamWriterFilter removeFilter()
Copyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.