public class XOPEncodingStreamWriter extends XOPEncodingStreamWrapper implements XMLStreamWriter, DataHandlerWriter
XMLStreamWriter wrapper that encodes XOP. It implements the extension
defined by DataHandlerWriter. The DataHandler
objects for the parts referenced by xop:Include element information items produced by
an instance of this class can be retrieved using the XOPEncodingStreamWrapper.getDataHandler(String) method.PROPERTY| Constructor and Description |
|---|
XOPEncodingStreamWriter(XMLStreamWriter parent,
ContentIDGenerator contentIDGenerator,
OptimizationPolicy optimizationPolicy)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush() |
NamespaceContext |
getNamespaceContext() |
String |
getPrefix(String uri) |
Object |
getProperty(String name) |
void |
setDefaultNamespace(String uri) |
void |
setNamespaceContext(NamespaceContext context) |
void |
setPrefix(String prefix,
String uri) |
void |
writeAttribute(String localName,
String value) |
void |
writeAttribute(String namespaceURI,
String localName,
String value) |
void |
writeAttribute(String prefix,
String namespaceURI,
String localName,
String value) |
void |
writeCData(String data) |
void |
writeCharacters(char[] text,
int start,
int len) |
void |
writeCharacters(String text) |
void |
writeComment(String data) |
void |
writeDataHandler(DataHandlerProvider dataHandlerProvider,
String contentID,
boolean optimize)
Write binary content to the stream.
|
void |
writeDataHandler(DataHandler dataHandler,
String contentID,
boolean optimize)
Write binary content to the stream.
|
void |
writeDefaultNamespace(String namespaceURI) |
void |
writeDTD(String dtd) |
void |
writeEmptyElement(String localName) |
void |
writeEmptyElement(String namespaceURI,
String localName) |
void |
writeEmptyElement(String prefix,
String localName,
String namespaceURI) |
void |
writeEndDocument() |
void |
writeEndElement() |
void |
writeEntityRef(String name) |
void |
writeNamespace(String prefix,
String namespaceURI) |
void |
writeProcessingInstruction(String target) |
void |
writeProcessingInstruction(String target,
String data) |
void |
writeStartDocument() |
void |
writeStartDocument(String version) |
void |
writeStartDocument(String encoding,
String version) |
void |
writeStartElement(String localName) |
void |
writeStartElement(String namespaceURI,
String localName) |
void |
writeStartElement(String prefix,
String localName,
String namespaceURI) |
getContentIDs, getDataHandler, isLoaded, processDataHandler, processDataHandlerpublic XOPEncodingStreamWriter(XMLStreamWriter parent, ContentIDGenerator contentIDGenerator, OptimizationPolicy optimizationPolicy)
parent - the XML stream to write the encoded infoset tocontentIDGenerator - used to generate content IDs for the binary content encoded as
xop:Include element information itemsoptimizationPolicy - the policy to apply to decide which binary content to optimizepublic Object getProperty(String name) throws IllegalArgumentException
getProperty in interface XMLStreamWriterIllegalArgumentExceptionpublic void writeDataHandler(DataHandler dataHandler, String contentID, boolean optimize) throws IOException, XMLStreamException
DataHandlerWriterwriteDataHandler in interface DataHandlerWriterdataHandler - the binary content to writecontentID - an existing content ID for the binary data (see above)optimize - indicates whether the content is eligible for optimization (see above)IOException - if an error occurs while reading from the data handlerXMLStreamException - if an error occurs while writing to the underlying streampublic void writeDataHandler(DataHandlerProvider dataHandlerProvider, String contentID, boolean optimize) throws IOException, XMLStreamException
DataHandlerWriterwriteDataHandler in interface DataHandlerWriterdataHandlerProvider - the binary content to writecontentID - an existing content ID for the binary data (see above)optimize - indicates whether the content is eligible for optimization (see above)IOException - If an error occurs while reading from the data handler. Since the implementation
is free to override the supplied optimize argument, it may attempt
to load the binary data immediately. Because this operation may fail, the method
must declare this exception.XMLStreamException - if an error occurs while writing to the underlying streampublic void close()
throws XMLStreamException
close in interface XMLStreamWriterXMLStreamExceptionpublic void flush()
throws XMLStreamException
flush in interface XMLStreamWriterXMLStreamExceptionpublic NamespaceContext getNamespaceContext()
getNamespaceContext in interface XMLStreamWriterpublic String getPrefix(String uri) throws XMLStreamException
getPrefix in interface XMLStreamWriterXMLStreamExceptionpublic void setDefaultNamespace(String uri) throws XMLStreamException
setDefaultNamespace in interface XMLStreamWriterXMLStreamExceptionpublic void setNamespaceContext(NamespaceContext context) throws XMLStreamException
setNamespaceContext in interface XMLStreamWriterXMLStreamExceptionpublic void setPrefix(String prefix, String uri) throws XMLStreamException
setPrefix in interface XMLStreamWriterXMLStreamExceptionpublic void writeAttribute(String prefix, String namespaceURI, String localName, String value) throws XMLStreamException
writeAttribute in interface XMLStreamWriterXMLStreamExceptionpublic void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException
writeAttribute in interface XMLStreamWriterXMLStreamExceptionpublic void writeAttribute(String localName, String value) throws XMLStreamException
writeAttribute in interface XMLStreamWriterXMLStreamExceptionpublic void writeCData(String data) throws XMLStreamException
writeCData in interface XMLStreamWriterXMLStreamExceptionpublic void writeCharacters(char[] text,
int start,
int len)
throws XMLStreamException
writeCharacters in interface XMLStreamWriterXMLStreamExceptionpublic void writeCharacters(String text) throws XMLStreamException
writeCharacters in interface XMLStreamWriterXMLStreamExceptionpublic void writeComment(String data) throws XMLStreamException
writeComment in interface XMLStreamWriterXMLStreamExceptionpublic void writeDefaultNamespace(String namespaceURI) throws XMLStreamException
writeDefaultNamespace in interface XMLStreamWriterXMLStreamExceptionpublic void writeDTD(String dtd) throws XMLStreamException
writeDTD in interface XMLStreamWriterXMLStreamExceptionpublic void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeEmptyElement(String localName) throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeEndDocument()
throws XMLStreamException
writeEndDocument in interface XMLStreamWriterXMLStreamExceptionpublic void writeEndElement()
throws XMLStreamException
writeEndElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeEntityRef(String name) throws XMLStreamException
writeEntityRef in interface XMLStreamWriterXMLStreamExceptionpublic void writeNamespace(String prefix, String namespaceURI) throws XMLStreamException
writeNamespace in interface XMLStreamWriterXMLStreamExceptionpublic void writeProcessingInstruction(String target, String data) throws XMLStreamException
writeProcessingInstruction in interface XMLStreamWriterXMLStreamExceptionpublic void writeProcessingInstruction(String target) throws XMLStreamException
writeProcessingInstruction in interface XMLStreamWriterXMLStreamExceptionpublic void writeStartDocument()
throws XMLStreamException
writeStartDocument in interface XMLStreamWriterXMLStreamExceptionpublic void writeStartDocument(String encoding, String version) throws XMLStreamException
writeStartDocument in interface XMLStreamWriterXMLStreamExceptionpublic void writeStartDocument(String version) throws XMLStreamException
writeStartDocument in interface XMLStreamWriterXMLStreamExceptionpublic void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException
writeStartElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeStartElement(String namespaceURI, String localName) throws XMLStreamException
writeStartElement in interface XMLStreamWriterXMLStreamExceptionpublic void writeStartElement(String localName) throws XMLStreamException
writeStartElement in interface XMLStreamWriterXMLStreamExceptionCopyright © 2004–2016 The Apache Software Foundation. All rights reserved.