org.springframework.batch.item.file.transform

## Class DefaultFieldSetFactory

- java.lang.Object
- - org.springframework.batch.item.file.transform.DefaultFieldSetFactory

- All Implemented Interfaces:
    FieldSetFactory

      public class DefaultFieldSetFactory
      extends java.lang.Object
      implements FieldSetFactory

  Default implementation of `FieldSetFactory` with no special knowledge of the `FieldSet` required. Returns a `DefaultFieldSet` from both factory methods.
  Author:
    Dave Syer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultFieldSetFactory()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `FieldSet` | `create(java.lang.String[] values)` Create a FieldSet with anonymous tokens.
    `FieldSet` | `create(java.lang.String[] values, java.lang.String[] names)` Create a FieldSet with named tokens.
    `void` | `setDateFormat(java.text.DateFormat dateFormat)` The `DateFormat` to use for parsing numbers.
    `void` | `setNumberFormat(java.text.NumberFormat numberFormat)` The `NumberFormat` to use for parsing numbers.

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

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

- - ### Constructor Detail

    - #### DefaultFieldSetFactory

          public DefaultFieldSetFactory()

  - ### Method Detail

    - #### setNumberFormat

          public void setNumberFormat(java.text.NumberFormat numberFormat)

      The `NumberFormat` to use for parsing numbers. If unset the default locale will be used.
      Parameters:
        `numberFormat` - the `NumberFormat` to use for number parsing

    - #### setDateFormat

          public void setDateFormat(java.text.DateFormat dateFormat)

      The `DateFormat` to use for parsing numbers. If unset the default pattern is ISO standard `yyyy/MM/dd`.
      Parameters:
        `dateFormat` - the `DateFormat` to use for date parsing

    - #### create

          public FieldSet create(java.lang.String[] values,
                                 java.lang.String[] names)

      Create a FieldSet with named tokens. The token values can then be retrieved either by name or by column number.
      Specified by:
        `create` in interface `FieldSetFactory`
      Parameters:
        `values` - the token values
        `names` - the names of the tokens
      See Also:
        `DefaultFieldSet.readString(String)`

    - #### create

          public FieldSet create(java.lang.String[] values)

      Create a FieldSet with anonymous tokens. They can only be retrieved by column number.
      Specified by:
        `create` in interface `FieldSetFactory`
      Parameters:
        `values` - the token values
      See Also:
        `FieldSet.readString(int)`