You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using your library to parse Excel files. Currently, I am facing an issue when I try to parse Excel cells that only contain blanks. When I use .preferNullOverDefault(true) I always get null values except when I leave that cell empty / unedited in which case I get an empty string.
For some cases this is fine. For example, some of the attributes of my parsed object are nullable. However, some of the attributes of my parsed object are non-nullable since I am working with Kotlin. I don't want these to be null but an empty string, because I want to validate with isBlank(), which can only be used with non-nullable strings. So when I call Poiji.fromExcel(file, ExampleEntry::class.java, getParsingOptions(XLS_EXAMPLE_SHEET_NAME, 2, 2)) these attributes also become null, which causes in error in my application.
Here are my parsing options, that I provide to fromExcel():
I think you could create a customizable Casting class that can make nullable strings to non-nullable ones. Please look into some related tasks and discussions about this context:
Hello,
I am using your library to parse Excel files. Currently, I am facing an issue when I try to parse Excel cells that only contain blanks. When I use
.preferNullOverDefault(true)
I always get null values except when I leave that cell empty / unedited in which case I get an empty string.For some cases this is fine. For example, some of the attributes of my parsed object are nullable. However, some of the attributes of my parsed object are non-nullable since I am working with Kotlin. I don't want these to be null but an empty string, because I want to validate with
isBlank()
, which can only be used with non-nullable strings. So when I callPoiji.fromExcel(file, ExampleEntry::class.java, getParsingOptions(XLS_EXAMPLE_SHEET_NAME, 2, 2))
these attributes also become null, which causes in error in my application.Here are my parsing options, that I provide to
fromExcel()
:Do you have any suggestions for a proper solution?
Thanks in advance!
The text was updated successfully, but these errors were encountered: