Class FixedWidthWriter


public class FixedWidthWriter extends AbstractWriter<FixedWidthWriterSettings>
A fast and flexible fixed-with writer implementation.
See Also:
  • Field Details

    • fieldLengths

      private int[] fieldLengths
    • fieldAlignments

      private FieldAlignment[] fieldAlignments
    • fieldPaddings

      private char[] fieldPaddings
    • padding

      private char padding
    • defaultPadding

      private char defaultPadding
    • length

      private int length
    • alignment

      private FieldAlignment alignment
    • lookaheadFormats

      private Lookup[] lookaheadFormats
    • lookbehindFormats

      private Lookup[] lookbehindFormats
    • lookupChars

      private char[] lookupChars
    • lookbehindFormat

      private Lookup lookbehindFormat
    • rootLengths

      private int[] rootLengths
    • rootAlignments

      private FieldAlignment[] rootAlignments
    • ignore

      private boolean[] ignore
    • rootIgnore

      private boolean[] rootIgnore
    • ignoreCount

      private int ignoreCount
    • rootPaddings

      private char[] rootPaddings
    • defaultHeaderPadding

      private boolean defaultHeaderPadding
    • defaultHeaderAlignment

      private FieldAlignment defaultHeaderAlignment
  • Constructor Details

    • FixedWidthWriter

      public FixedWidthWriter(FixedWidthWriterSettings settings)
      The FixedWidthWriter supports all settings provided by FixedWidthWriterSettings, and requires this configuration to be properly initialized.

      Important: by not providing an instance of Writer to this constructor, only the operations that write to Strings are available.

      Parameters:
      settings - the fixed-width writer configuration
    • FixedWidthWriter

      public FixedWidthWriter(Writer writer, FixedWidthWriterSettings settings)
      The FixedWidthWriter supports all settings provided by FixedWidthWriterSettings, and requires this configuration to be properly initialized.
      Parameters:
      writer - the output resource that will receive fixed-width records produced by this class.
      settings - the fixed-width writer configuration
    • FixedWidthWriter

      public FixedWidthWriter(File file, FixedWidthWriterSettings settings)
      The FixedWidthWriter supports all settings provided by FixedWidthWriterSettings, and requires this configuration to be properly initialized.
      Parameters:
      file - the output file that will receive fixed-width records produced by this class.
      settings - the fixed-width writer configuration
    • FixedWidthWriter

      public FixedWidthWriter(File file, String encoding, FixedWidthWriterSettings settings)
      The FixedWidthWriter supports all settings provided by FixedWidthWriterSettings, and requires this configuration to be properly initialized.
      Parameters:
      file - the output file that will receive fixed-width records produced by this class.
      encoding - the encoding of the file
      settings - the fixed-width writer configuration
    • FixedWidthWriter

      public FixedWidthWriter(File file, Charset encoding, FixedWidthWriterSettings settings)
      The FixedWidthWriter supports all settings provided by FixedWidthWriterSettings, and requires this configuration to be properly initialized.
      Parameters:
      file - the output file that will receive fixed-width records produced by this class.
      encoding - the encoding of the file
      settings - the fixed-width writer configuration
    • FixedWidthWriter

      public FixedWidthWriter(OutputStream output, FixedWidthWriterSettings settings)
      The FixedWidthWriter supports all settings provided by FixedWidthWriterSettings, and requires this configuration to be properly initialized.
      Parameters:
      output - the output stream that will be written with the fixed-width records produced by this class.
      settings - the fixed-width writer configuration
    • FixedWidthWriter

      public FixedWidthWriter(OutputStream output, String encoding, FixedWidthWriterSettings settings)
      The FixedWidthWriter supports all settings provided by FixedWidthWriterSettings, and requires this configuration to be properly initialized.
      Parameters:
      output - the output stream that will be written with the fixed-width records produced by this class.
      encoding - the encoding of the stream
      settings - the fixed-width writer configuration
    • FixedWidthWriter

      public FixedWidthWriter(OutputStream output, Charset encoding, FixedWidthWriterSettings settings)
      The FixedWidthWriter supports all settings provided by FixedWidthWriterSettings, and requires this configuration to be properly initialized.
      Parameters:
      output - the output stream that will be written with the fixed-width records produced by this class.
      encoding - the encoding of the stream
      settings - the fixed-width writer configuration
  • Method Details