public class XMLJoiner extends XMLEventUtilBase implements Closeable, Flushable
startDocument()
, endDocument()
,
findObjectStart()
, XMLEventUtilBase.addObjectEvent(javax.xml.stream.events.XMLEvent)
, and XMLEventUtilBase.finishObject()
). This class must be closed before the
stream will be completely written (and to free underlying resources).logger, NAMESPACE_AWARE_PROP, REPAIR_NAMESPACE_PROP
Modifier | Constructor and Description |
---|---|
protected |
XMLJoiner() |
protected |
XMLJoiner(XMLEventWriter writer) |
protected |
XMLJoiner(XMLEventWriter writer,
XMLInputFactory inFactory) |
protected |
XMLJoiner(XMLInputFactory inFactory,
XMLOutputFactory outFactory) |
protected |
XMLJoiner(XMLOutputFactory outFactory) |
Modifier and Type | Method and Description |
---|---|
protected void |
closeImpl()
Does the actual close work for this instance, will only be called once.
|
protected void |
endDocument()
Called after all object events have been written to the writer.
|
protected XMLEvent |
findObjectStart()
Finds the first event for the start of the next input object from the current reader.
|
void |
flush() |
protected void |
initialize() |
protected void |
startDocument()
Called before any events are written to the writer.
|
void |
write(InputStream in)
Writes the given InputStream to the xml output writer.
|
void |
write(ObjectData data)
Writes the given ObjectData to the xml output writer.
|
void |
writeAll(Iterable<ObjectData> datas)
Writes all of the ObjectDatas to the xml output writer.
|
addObjectEvent, close, closeQuietly, closeReader, closeWriter, createEventFactory, createInputFactory, createInputFactory, createOutputFactory, createOutputFactory, findNextElementStart, finishObject, getEventFactory, getInputFactory, getOutputFactory, getReader, getWriter, openReader, openWriter, setReader, setWriter, startObject
protected XMLJoiner()
protected XMLJoiner(XMLOutputFactory outFactory)
protected XMLJoiner(XMLEventWriter writer)
protected XMLJoiner(XMLEventWriter writer, XMLInputFactory inFactory)
protected XMLJoiner(XMLInputFactory inFactory, XMLOutputFactory outFactory)
protected void initialize() throws XMLStreamException
XMLStreamException
public void writeAll(Iterable<ObjectData> datas)
datas
- collection of ObjectDatas to be written, may be null
public void write(ObjectData data)
data
- an individual ObjectData to write, may be null
public void write(InputStream in)
in
- an InputStream to write, may be null
protected void startDocument() throws XMLStreamException
Base class writes a start-document event.
XMLStreamException
protected void endDocument() throws XMLStreamException
Base class does nothing.
XMLStreamException
protected XMLEvent findObjectStart() throws XMLStreamException
Default implementation returns the first start-element event.
null
if there is no object in the readerXMLStreamException
protected void closeImpl()
XMLEventUtilBase
closeImpl
in class XMLEventUtilBase