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>
A builder for constructing a
FormatterLineAggregator
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
fieldExtractor
(FieldExtractor<T> fieldExtractor) Set theFieldExtractor
to use to extract fields from each item.Set the format string used to aggregate itemsSet the locale.maximumLength
(int maximumLength) Set the maximum length of the formatted string.minimumLength
(int minimumLength) Set the minimum length of the formatted string.Names of each of the fields within the fields that are returned in the order they occur within the formatted file.sourceType
(Class<T> sourceType) Specify the type of items from which fields will be extracted.
-
Constructor Details
-
FormattedBuilder
-
-
Method Details
-
format
Set the format string used to aggregate items- Parameters:
format
- used to aggregate items- Returns:
- The instance of the builder for chaining.
-
locale
Set the locale.- Parameters:
locale
- to use- Returns:
- The instance of the builder for chaining.
-
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
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.
-
sourceType
Specify the type of items from which fields will be extracted. This is used to configure the rightFieldExtractor
based on the given type (ie a record or a regular class).- Parameters:
sourceType
- type of items from which fields will be extracted- Returns:
- The current instance of the builder.
- Since:
- 5.0
-
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
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:
-
build
-