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, open
public XmlWriter(XmlSink.XmlWriteOperation<T> writeOperation, Marshaller marshaller)
protected void prepareWrite(WritableByteChannel channel) throws Exception
prepareWrite
in class FileBasedSink.FileBasedWriter<T>
Exception
protected void writeHeader() throws Exception
writeHeader
in class FileBasedSink.FileBasedWriter<T>
Exception
protected void writeFooter() throws Exception
writeFooter
in class FileBasedSink.FileBasedWriter<T>
Exception
public void write(T value) throws Exception
write
in class Sink.Writer<T,FileBasedSink.FileResult>
Exception
public XmlSink.XmlWriteOperation<T> getWriteOperation()
getWriteOperation
in class FileBasedSink.FileBasedWriter<T>