Package org.springframework.batch.item.file.builder

# Class FlatFileItemReaderBuilder.FixedLengthBuilder<T>

java.lang.Object
org.springframework.batch.item.file.builder.FlatFileItemReaderBuilder.FixedLengthBuilder<T>

Type Parameters:
  `T` - the type of the parent `FlatFileItemReaderBuilder`

Enclosing class:
  FlatFileItemReaderBuilder<T>

public static class FlatFileItemReaderBuilder.FixedLengthBuilder<T> extends Object
A builder for constructing a `FixedLengthTokenizer`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `FixedLengthBuilder(FlatFileItemReaderBuilder<T> parent)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `FlatFileItemReaderBuilder.FixedLengthBuilder<T>`
  `addColumns(Range range)`
  Add a column range to the existing list
  `FlatFileItemReaderBuilder.FixedLengthBuilder<T>`
  `addColumns(Range range, int index)`
  Insert a column range to the existing list
  `FixedLengthTokenizer`
  `build()`
  Returns a `FixedLengthTokenizer`
  `FlatFileItemReaderBuilder.FixedLengthBuilder<T>`
  `columns(Range... ranges)`
  The column ranges for each field
  `FlatFileItemReaderBuilder.FixedLengthBuilder<T>`
  `fieldSetFactory(FieldSetFactory fieldSetFactory)`
  A factory for creating the resulting `FieldSet`.
  `FlatFileItemReaderBuilder<T>`
  `names(String... names)`
  The names of the fields to be parsed from the file.
  `FlatFileItemReaderBuilder.FixedLengthBuilder<T>`
  `strict(boolean strict)`
  Boolean indicating if the number of tokens in a line must match the number of fields (ranges) configured.

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

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

- ## Constructor Details

  - ### FixedLengthBuilder

    protected FixedLengthBuilder(FlatFileItemReaderBuilder<T> parent)

- ## Method Details

  - ### columns

    public FlatFileItemReaderBuilder.FixedLengthBuilder<T> columns(Range... ranges)
    The column ranges for each field
    Parameters:
      `ranges` - column ranges
    Returns:
      This instance for chaining
    See Also:
      - `FixedLengthTokenizer.setColumns(Range[])`

  - ### addColumns

    public FlatFileItemReaderBuilder.FixedLengthBuilder<T> addColumns(Range range)
    Add a column range to the existing list
    Parameters:
      `range` - a new column range
    Returns:
      This instance for chaining
    See Also:
      - `FixedLengthTokenizer.setColumns(Range[])`

  - ### addColumns

    public FlatFileItemReaderBuilder.FixedLengthBuilder<T> addColumns(Range range, int index)
    Insert a column range to the existing list
    Parameters:
      `range` - a new column range
      `index` - index to add it at
    Returns:
      This instance for chaining
    See Also:
      - `FixedLengthTokenizer.setColumns(Range[])`

  - ### names

    public FlatFileItemReaderBuilder<T> names(String... names)
    The names of the fields to be parsed from the file. Required.
    Parameters:
      `names` - names of fields
    Returns:
      The parent builder
    See Also:
      - `AbstractLineTokenizer.setNames(String[])`

  - ### strict

    public FlatFileItemReaderBuilder.FixedLengthBuilder<T> strict(boolean strict)
    Boolean indicating if the number of tokens in a line must match the number of fields (ranges) configured. Defaults to true.
    Parameters:
      `strict` - defaults to true
    Returns:
      This instance for chaining
    See Also:
      - `AbstractLineTokenizer.setStrict(boolean)`

  - ### fieldSetFactory

    public FlatFileItemReaderBuilder.FixedLengthBuilder<T> fieldSetFactory(FieldSetFactory fieldSetFactory)
    A factory for creating the resulting `FieldSet`. Defaults to `DefaultFieldSetFactory`.
    Parameters:
      `fieldSetFactory` - Factory for creating `FieldSet`
    Returns:
      The instance of the builder for chaining.
    See Also:
      - `AbstractLineTokenizer.setFieldSetFactory(FieldSetFactory)`

  - ### build

    public FixedLengthTokenizer build()
    Returns a `FixedLengthTokenizer`
    Returns:
      a `FixedLengthTokenizer`