Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure the right FieldExtractor based on the type of items in FlatFileItemWriterBuilder #4161

Closed
fmbenhassine opened this issue Jul 20, 2022 · 0 comments

Comments

@fmbenhassine
Copy link
Contributor

Similar to #4160, the FlatFileItemWriterBuilder can use the java.lang.Class#isRecord API to detect if the type of items is a record or a regular class and configure the right FieldExtractor accordingly (ie RecordFieldExtractor for records and BeanWrapperFieldExtractor for regular classes).

The goal of this issue is to implement this idea to make the configuration of the right FieldExtractor transparent to the user.

@fmbenhassine fmbenhassine added this to the 5.0.0-M4 milestone Jul 20, 2022
fmbenhassine added a commit to fmbenhassine/spring-batch that referenced this issue Jul 20, 2022
…n FlatFileItemWriterBuilder

This is an attempt to get the generic type information
at runtime from the builder and use it to detect if
items type is a record or a regular class.

This seems impossible due to type erasure.

Issue spring-projects#4161
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant