public class XMLMultipleStreamWriter extends StreamWriterDelegate
<?xml-multiple?>
processing instructions when writing a sequence of elements matching some
element path. Use this class to trigger JSON array start events like this:
XMLOutputFactory factory = new JsonXMLOutputFactory(); XMLEventWriter writer = factory.createXMLStreamWriter(...); writer = new XMLMultipleStreamWriter(writer, false, "/alice/bob", ...);
| Constructor and Description |
|---|
XMLMultipleStreamWriter(XMLStreamWriter parent,
boolean matchRoot,
String... multiplePaths)
Create instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMultiplePath(String path)
Add path to trigger
<?xml-multiple?> PI. |
void |
setParent(XMLStreamWriter parent) |
void |
writeEmptyElement(String localName) |
void |
writeEmptyElement(String namespaceURI,
String localName) |
void |
writeEmptyElement(String prefix,
String localName,
String namespaceURI) |
void |
writeEndElement() |
void |
writeStartElement(String localName) |
void |
writeStartElement(String namespaceURI,
String localName) |
void |
writeStartElement(String prefix,
String localName,
String namespaceURI) |
close, flush, getNamespaceContext, getParent, getPrefix, getProperty, setDefaultNamespace, setNamespaceContext, setPrefix, writeAttribute, writeAttribute, writeAttribute, writeCData, writeCharacters, writeCharacters, writeComment, writeDefaultNamespace, writeDTD, writeEndDocument, writeEntityRef, writeNamespace, writeProcessingInstruction, writeProcessingInstruction, writeStartDocument, writeStartDocument, writeStartDocumentpublic XMLMultipleStreamWriter(XMLStreamWriter parent, boolean matchRoot, String... multiplePaths) throws XMLStreamException
parent - delegatematchRoot - whether the root element is included in pathsmultiplePaths - added via addMultiplePath(String)XMLStreamExceptionpublic void setParent(XMLStreamWriter parent)
setParent in class StreamWriterDelegatepublic void addMultiplePath(String path) throws XMLStreamException
<?xml-multiple?> PI.
The path may start with '/' and contain local element
names, separated by '/', e.g
"/foo/bar", "foo/bar" or "bar".path - multiple pathXMLStreamException - if the path is invalidpublic void writeEmptyElement(String localName) throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterwriteEmptyElement in class StreamWriterDelegateXMLStreamExceptionpublic void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterwriteEmptyElement in class StreamWriterDelegateXMLStreamExceptionpublic void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException
writeEmptyElement in interface XMLStreamWriterwriteEmptyElement in class StreamWriterDelegateXMLStreamExceptionpublic void writeStartElement(String localName) throws XMLStreamException
writeStartElement in interface XMLStreamWriterwriteStartElement in class StreamWriterDelegateXMLStreamExceptionpublic void writeStartElement(String namespaceURI, String localName) throws XMLStreamException
writeStartElement in interface XMLStreamWriterwriteStartElement in class StreamWriterDelegateXMLStreamExceptionpublic void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException
writeStartElement in interface XMLStreamWriterwriteStartElement in class StreamWriterDelegateXMLStreamExceptionpublic void writeEndElement()
throws XMLStreamException
writeEndElement in interface XMLStreamWriterwriteEndElement in class StreamWriterDelegateXMLStreamExceptionCopyright © 2005–2019 Apache Software Foundation. All rights reserved.