com.google.cloud.dataflow.sdk.io

## Class XmlSink.Bound<T>

- java.lang.Object
- - com.google.cloud.dataflow.sdk.io.Sink<T>
  - - com.google.cloud.dataflow.sdk.io.FileBasedSink<T>
    - - com.google.cloud.dataflow.sdk.io.XmlSink.Bound<T>

All Implemented Interfaces:
  HasDisplayData, Serializable

Enclosing class:
  XmlSink

    public static class XmlSink.Bound<T>
    extends FileBasedSink<T>

A `FileBasedSink` that writes objects as XML elements.

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class com.google.cloud.dataflow.sdk.io.FileBasedSink

`FileBasedSink.FileBasedWriteOperation<T>, FileBasedSink.FileBasedWriter<T>, FileBasedSink.FileResult`

### Nested classes/interfaces inherited from class com.google.cloud.dataflow.sdk.io.Sink

`Sink.WriteOperation<T,WriteT>, Sink.Writer<T,WriteT>`

### Field Summary

### Fields inherited from class com.google.cloud.dataflow.sdk.io.FileBasedSink

`baseOutputFilename, extension, fileNamingTemplate`

### Method Summary

All Methods Instance Methods Concrete Methods
`XmlSink.XmlWriteOperation<T>` `createWriteOperation(PipelineOptions options)` Creates an `XmlSink.XmlWriteOperation`.
`<T> XmlSink.Bound<T>` `ofRecordClass(Class<T> classToBind)` Returns an XmlSink that writes objects of the class specified as XML elements.
`void` `populateDisplayData(DisplayData.Builder builder)` Register display data for the given transform or component.
`XmlSink.Bound<T>` `toFilenamePrefix(String baseOutputFilename)` Returns an XmlSink that writes to files with the given prefix.
`void` `validate(PipelineOptions options)` Validates that the root element, class to bind to a JAXB context, and filenamePrefix have been set and that the class can be bound in a JAXB context.
`XmlSink.Bound<T>` `withRootElement(String rootElementName)` Returns an XmlSink that writes XML files with an enclosing root element of the supplied name.

### Methods inherited from class com.google.cloud.dataflow.sdk.io.FileBasedSink

`getBaseOutputFilename`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### ofRecordClass

    public <T> XmlSink.Bound<T> ofRecordClass(Class<T> classToBind)

Returns an XmlSink that writes objects of the class specified as XML elements.

The specified class must be able to be used to create a JAXB context.

#### toFilenamePrefix

    public XmlSink.Bound<T> toFilenamePrefix(String baseOutputFilename)

Returns an XmlSink that writes to files with the given prefix.

Output files will have the name {filenamePrefix}-0000i-of-0000n.xml where n is the number of output bundles that the Dataflow service divides the output into.

#### withRootElement

    public XmlSink.Bound<T> withRootElement(String rootElementName)

Returns an XmlSink that writes XML files with an enclosing root element of the supplied name.

#### validate

    public void validate(PipelineOptions options)

Validates that the root element, class to bind to a JAXB context, and filenamePrefix have been set and that the class can be bound in a JAXB context.

Overrides:
  `validate` in class `FileBasedSink<T>`

#### createWriteOperation

    public XmlSink.XmlWriteOperation<T> createWriteOperation(PipelineOptions options)

Creates an `XmlSink.XmlWriteOperation`.

Specified by:
  `createWriteOperation` in class `FileBasedSink<T>`

#### populateDisplayData

    public void populateDisplayData(DisplayData.Builder builder)

Description copied from class: `Sink`
Register display data for the given transform or component.

`populateDisplayData(DisplayData.Builder)` is invoked by Pipeline runners to collect display data via `DisplayData.from(HasDisplayData)`. Implementations may call `super.populateDisplayData(builder)` in order to register display data in the current namespace, but should otherwise use `subcomponent.populateDisplayData(builder)` to use the namespace of the subcomponent.

By default, does not register any display data. Implementors may override this method to provide their own display data.

Specified by:
  `populateDisplayData` in interface `HasDisplayData`
Overrides:
  `populateDisplayData` in class `FileBasedSink<T>`
Parameters:
  `builder` - The builder to populate with display data.
See Also:
  `HasDisplayData`