Document on how to use the BeanWrapperRowMapper with the StreamingXlsxItemReader as that requires a bit more configuration due to the streaming nature.
Next to the documentation also added a test case for this to show how to configure it as well.
Closes: #115
Prior to this commit it was impossible to modify or configure the DataFormatter and FormulaEvaluator in use. With this commit we resolve this by introducing two interfaces. 1 DataFormatterCustomizer to customize/configure the the DataFormatter in use. 1 interface the FormulaEvaluatorFactory which is a factory used to create the FormulaEvaluator.
The default DataFormatterCustomizer will configure the formatter to use the cached values from cells instead of evaluating the formulas.
The default FormulaEvaluatorFactory in use will always return null instead of creating a FormulaEvaluator.
Fixes: #126
Prior to this commit all date related fields were formatted as an
ISO_LOCAL_DATE_TIME.
With this commit we inspect the type it actually is date, time or
datetime and use the proper ISO_LOCAL formatting for that.
Another improvement is to use the cached result for the formula instead
of re-evaluating the formula and use that type.
With this commit we upgrade the java formatting to the new version and
also adhere to the standards applied there. Mainly for Junit5 names of
the test classes and visibility of methods.
Closes: #138
The format used the ISO_OFFSET_DATE_TIME is the wrong one and leads to errors
formatting the date. Instead we should have used the ISO_LOCAL_DATE_TIME instead.
This commit fixes that and also includes a bug fix for the XLSX variant as that didn't
use the overridden method. The correct method for this has been overridden now also
formatting the dates/times for that using the ISO_LOCAL_DATE_TIME format.
Tests for different types have been added as well, as to make sure this
keeps working for newer versions.
Closes: #121
The itemreaders provided by this project are reading only. So it makes
sense to open them with only read-only priviliges. We already did this
for the streaming version of the itemreader. With this commit we also
enable this for the regular itemreader.
Closes: #128
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
* Optionally use ISO formatting for dates
Prior to this commit we always used the date pattern as
assigned in the Excel workbook for the cell. Which could
lead to surprising results.
We now allow the dates to be formatted as an ISO date time with
offset, so dates/times are consistently formatted in the result.
Closes: #88
With this commit we use the isFile check introduced in
Spring 5 to check if something is an actaul file resource
instead of relying on FileNotFoundException.
Resource implementations didn't consistently throw a
FileNotFoundException (like the Google Big Query one)
leading to issues with reading.
Closes: 89
When there are blank or empty lines in the end of one sheet, null is returned by doRead without trying to read next sheet. A recursive call makes sheet moving happen when another exists.
Co-authored-by: Mahmoud Ben Hassine <mbenhassine@vmware.com>
Co-authored-by: cesar.alves@gmail.com <coa@pc-coa.caso.pt>