Class FlatFileItemWriterBuilder.FormattedBuilder<T>
- java.lang.Object
- org.springframework.batch.item.file.builder.FlatFileItemWriterBuilder.FormattedBuilder<T>
- Type Parameters:
T
- the type of the parentFlatFileItemWriterBuilder
- Enclosing class:
- FlatFileItemWriterBuilder<T>
public static class FlatFileItemWriterBuilder.FormattedBuilder<T> extends java.lang.Object
A builder for constructing aFormatterLineAggregator
.
Constructor Summary
Constructors Modifier Constructor Description protected
FormattedBuilder(FlatFileItemWriterBuilder<T> parent)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FormatterLineAggregator<T>
build()
FlatFileItemWriterBuilder<T>
fieldExtractor(FieldExtractor<T> fieldExtractor)
Set theFieldExtractor
to use to extract fields from each item.FlatFileItemWriterBuilder.FormattedBuilder<T>
format(java.lang.String format)
Set the format string used to aggregate itemsFlatFileItemWriterBuilder.FormattedBuilder<T>
locale(java.util.Locale locale)
Set the locale.FlatFileItemWriterBuilder.FormattedBuilder<T>
maximumLength(int maximumLength)
Set the maximum length of the formatted string.FlatFileItemWriterBuilder.FormattedBuilder<T>
minimumLength(int minimumLength)
Set the minimum length of the formatted string.FlatFileItemWriterBuilder<T>
names(java.lang.String[] names)
Names of each of the fields within the fields that are returned in the order they occur within the formatted file.
Constructor Detail
FormattedBuilder
protected FormattedBuilder(FlatFileItemWriterBuilder<T> parent)
Method Detail
format
public FlatFileItemWriterBuilder.FormattedBuilder<T> format(java.lang.String format)
Set the format string used to aggregate items- Parameters:
format
- used to aggregate items- Returns:
- The instance of the builder for chaining.
locale
public FlatFileItemWriterBuilder.FormattedBuilder<T> locale(java.util.Locale locale)
Set the locale.- Parameters:
locale
- to use- Returns:
- The instance of the builder for chaining.
minimumLength
public FlatFileItemWriterBuilder.FormattedBuilder<T> minimumLength(int minimumLength)
Set the minimum length of the formatted string. If this is not set the default is to allow any length.- Parameters:
minimumLength
- of the formatted string- Returns:
- The instance of the builder for chaining.
maximumLength
public FlatFileItemWriterBuilder.FormattedBuilder<T> maximumLength(int maximumLength)
Set the maximum length of the formatted string. If this is not set the default is to allow any length.- Parameters:
maximumLength
- of the formatted string- Returns:
- The instance of the builder for chaining.
fieldExtractor
public FlatFileItemWriterBuilder<T> fieldExtractor(FieldExtractor<T> fieldExtractor)
Set theFieldExtractor
to use to extract fields from each item.- Parameters:
fieldExtractor
- to use to extract fields from each item- Returns:
- The current instance of the builder
names
public FlatFileItemWriterBuilder<T> names(java.lang.String[] names)
Names of each of the fields within the fields that are returned in the order they occur within the formatted file. These names will be used to create aBeanWrapperFieldExtractor
only if no explicit field extractor is set viafieldExtractor(FieldExtractor)
.- Parameters:
names
- names of each field- Returns:
- The parent
FlatFileItemWriterBuilder
- See Also:
BeanWrapperFieldExtractor.setNames(String[])
build
public FormatterLineAggregator<T> build()