spring-projects / spring-batch-extensions

Spring Batch Extensions
242 stars 258 forks source link

Allow a Locale to be set for formatting #100

Closed mdeinum closed 1 year ago

mdeinum commented 1 year ago

The internal DataFormatter used from Apache POI allows for setting a fixed Locale to use when reading numbers, dates etc. Initially we didn't set this and thus it always used the default Locale as set from the Java runtime. This could lead to unexpected results. We now allow to set the userLocale property and use this to configure the DataFormatter used internally.

We also took the opportunity to make this work with the streaming ItemReader as well as the regular ItemReader. The streaming item reader now also uses a pre-configured DataFormatter.

Closes: #98