Class XmlIO.Write<T>

  • All Implemented Interfaces:
    java.io.Serializable, org.apache.beam.sdk.transforms.display.HasDisplayData
    Enclosing class:
    XmlIO

    public abstract static class XmlIO.Write<T>
    extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<T>,​org.apache.beam.sdk.values.PDone>
    Implementation of XmlIO.write().
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class org.apache.beam.sdk.transforms.PTransform

        annotations, displayData, name, resourceHints
    • Constructor Summary

      Constructors 
      Constructor Description
      Write()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.beam.sdk.values.PDone expand​(org.apache.beam.sdk.values.PCollection<T> input)  
      void populateDisplayData​(org.apache.beam.sdk.transforms.display.DisplayData.Builder builder)  
      XmlIO.Write<T> to​(java.lang.String filenamePrefix)
      Writes to files with the given path prefix.
      XmlIO.Write<T> withCharset​(java.nio.charset.Charset charset)
      Sets the charset used to write the file.
      XmlIO.Write<T> withRecordClass​(java.lang.Class<T> recordClass)
      Writes objects of the given class mapped to XML elements using JAXB.
      XmlIO.Write<T> withRootElement​(java.lang.String rootElement)
      Sets the enclosing root element for the generated XML files.
      • Methods inherited from class org.apache.beam.sdk.transforms.PTransform

        addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, setDisplayData, setResourceHints, toString, validate, validate
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Write

        public Write()
    • Method Detail

      • to

        public XmlIO.Write<T> to​(java.lang.String filenamePrefix)
        Writes to files with the given path prefix.

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

      • withRecordClass

        public XmlIO.Write<T> withRecordClass​(java.lang.Class<T> recordClass)
        Writes objects of the given class mapped to XML elements using JAXB.

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

      • withRootElement

        public XmlIO.Write<T> withRootElement​(java.lang.String rootElement)
        Sets the enclosing root element for the generated XML files.
      • withCharset

        public XmlIO.Write<T> withCharset​(java.nio.charset.Charset charset)
        Sets the charset used to write the file.
      • expand

        public org.apache.beam.sdk.values.PDone expand​(org.apache.beam.sdk.values.PCollection<T> input)
        Specified by:
        expand in class org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<T>,​org.apache.beam.sdk.values.PDone>
      • populateDisplayData

        public void populateDisplayData​(org.apache.beam.sdk.transforms.display.DisplayData.Builder builder)
        Specified by:
        populateDisplayData in interface org.apache.beam.sdk.transforms.display.HasDisplayData
        Overrides:
        populateDisplayData in class org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<T>,​org.apache.beam.sdk.values.PDone>