Class FlatFileItemWriterBuilder.FormattedBuilder<T>
java.lang.Object
org.springframework.batch.item.file.builder.FlatFileItemWriterBuilder.FormattedBuilder<T>
- Type Parameters:
- T- the type of the parent- FlatFileItemWriterBuilder
- Enclosing class:
- FlatFileItemWriterBuilder<T>
A builder for constructing a 
FormatterLineAggregator.- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbuild()fieldExtractor(FieldExtractor<T> fieldExtractor) Set theFieldExtractorto 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- 
formatSet the format string used to aggregate items- Parameters:
- format- used to aggregate items
- Returns:
- The instance of the builder for chaining.
 
- 
localeSet the locale.- Parameters:
- locale- to use
- Returns:
- The instance of the builder for chaining.
 
- 
minimumLengthSet 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.
 
- 
maximumLengthSet 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.
 
- 
sourceTypeSpecify the type of items from which fields will be extracted. This is used to configure the rightFieldExtractorbased 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
 
- 
fieldExtractorSet theFieldExtractorto use to extract fields from each item.- Parameters:
- fieldExtractor- to use to extract fields from each item
- Returns:
- The current instance of the builder
 
- 
namesNames 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 aBeanWrapperFieldExtractoronly if no explicit field extractor is set viafieldExtractor(FieldExtractor).- Parameters:
- names- names of each field
- Returns:
- The parent FlatFileItemWriterBuilder
- See Also:
 
- 
build
 
-