Class FlatFileItemWriterBuilder.DelimitedBuilder<T>
java.lang.Object
org.springframework.batch.item.file.builder.FlatFileItemWriterBuilder.DelimitedBuilder<T>
- Type Parameters:
T
- the type of the parentFlatFileItemWriterBuilder
- Enclosing class:
- FlatFileItemWriterBuilder<T>
A builder for constructing a
DelimitedLineAggregator
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Define the delimiter for the file.fieldExtractor
(FieldExtractor<T> fieldExtractor) Set theFieldExtractor
to use to extract fields from each item.Names of each of the fields within the fields that are returned in the order they occur within the delimited file.quoteCharacter
(String quoteCharacter) Define the quote character for each delimited field.sourceType
(Class<T> sourceType) Specify the type of items from which fields will be extracted.
-
Constructor Details
-
DelimitedBuilder
-
-
Method Details
-
delimiter
Define the delimiter for the file.- Parameters:
delimiter
- String used as a delimiter between fields.- Returns:
- The instance of the builder for chaining.
- See Also:
-
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
-
quoteCharacter
Define the quote character for each delimited field. Default is empty string.- Parameters:
quoteCharacter
- String used as a quote for the aggregate.- Returns:
- The instance of the builder for chaining.
- Since:
- 5.1
- See Also:
-
names
Names of each of the fields within the fields that are returned in the order they occur within the delimited 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:
-
fieldExtractor
Set theFieldExtractor
to use to extract fields from each item.- Parameters:
fieldExtractor
- to use to extract fields from each item- Returns:
- The parent
FlatFileItemWriterBuilder
-
build
-