protected static final class XmlSink.XmlWriter<T> extends FileBasedSink.FileBasedWriter<T>
Sink.Writer that can write objects as XML elements.mimeType| Constructor and Description |
|---|
XmlWriter(XmlSink.XmlWriteOperation<T> writeOperation,
Marshaller marshaller) |
| Modifier and Type | Method and Description |
|---|---|
XmlSink.XmlWriteOperation<T> |
getWriteOperation()
Return the XmlWriteOperation this write belongs to.
|
protected void |
prepareWrite(WritableByteChannel channel)
Creates the output stream that elements will be written to.
|
void |
write(T value)
Writes a value to the stream.
|
protected void |
writeFooter()
Writes the root element closing tag.
|
protected void |
writeHeader()
Writes the root element opening tag.
|
close, openpublic XmlWriter(XmlSink.XmlWriteOperation<T> writeOperation, Marshaller marshaller)
protected void prepareWrite(WritableByteChannel channel) throws Exception
prepareWrite in class FileBasedSink.FileBasedWriter<T>Exceptionprotected void writeHeader()
throws Exception
writeHeader in class FileBasedSink.FileBasedWriter<T>Exceptionprotected void writeFooter()
throws Exception
writeFooter in class FileBasedSink.FileBasedWriter<T>Exceptionpublic void write(T value) throws Exception
write in class Sink.Writer<T,FileBasedSink.FileResult>Exceptionpublic XmlSink.XmlWriteOperation<T> getWriteOperation()
getWriteOperation in class FileBasedSink.FileBasedWriter<T>