Google Cloud Dataflow SDK for Java, version 1.9.1
com.google.cloud.dataflow.sdk.io
Class XmlSink.XmlWriter<T>
- java.lang.Object
-
- com.google.cloud.dataflow.sdk.io.Sink.Writer<T,FileBasedSink.FileResult>
-
- com.google.cloud.dataflow.sdk.io.FileBasedSink.FileBasedWriter<T>
-
- com.google.cloud.dataflow.sdk.io.XmlSink.XmlWriter<T>
-
- Enclosing class:
- XmlSink
protected static final class XmlSink.XmlWriter<T> extends FileBasedSink.FileBasedWriter<T>
ASink.Writer
that can write objects as XML elements.
-
-
Field Summary
-
Fields inherited from class com.google.cloud.dataflow.sdk.io.FileBasedSink.FileBasedWriter
mimeType
-
-
Constructor Summary
Constructors Constructor and Description XmlWriter(XmlSink.XmlWriteOperation<T> writeOperation, Marshaller marshaller)
-
Method Summary
All Methods Instance Methods Concrete Methods 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.-
Methods inherited from class com.google.cloud.dataflow.sdk.io.FileBasedSink.FileBasedWriter
close, open
-
-
-
-
Constructor Detail
-
XmlWriter
public XmlWriter(XmlSink.XmlWriteOperation<T> writeOperation, Marshaller marshaller)
-
-
Method Detail
-
prepareWrite
protected void prepareWrite(WritableByteChannel channel) throws Exception
Creates the output stream that elements will be written to.- Specified by:
prepareWrite
in classFileBasedSink.FileBasedWriter<T>
- Throws:
Exception
-
writeHeader
protected void writeHeader() throws Exception
Writes the root element opening tag.- Overrides:
writeHeader
in classFileBasedSink.FileBasedWriter<T>
- Throws:
Exception
-
writeFooter
protected void writeFooter() throws Exception
Writes the root element closing tag.- Overrides:
writeFooter
in classFileBasedSink.FileBasedWriter<T>
- Throws:
Exception
-
write
public void write(T value) throws Exception
Writes a value to the stream.- Specified by:
write
in classSink.Writer<T,FileBasedSink.FileResult>
- Throws:
Exception
-
getWriteOperation
public XmlSink.XmlWriteOperation<T> getWriteOperation()
Return the XmlWriteOperation this write belongs to.- Overrides:
getWriteOperation
in classFileBasedSink.FileBasedWriter<T>
-
-