42BV / CSVeed

Light-weight, easy-to-use Java-based CSV utility
Apache License 2.0
100 stars 22 forks source link

Map nulls to empty values when writing beans #49

Open spatula75 opened 9 years ago

spatula75 commented 9 years ago

Currently if a mapped field in a bean is null, CSVeed will throw a NullPointerException when writing the row for that bean, because of the way RowWriterImpl.java line 107 works.

It would be nice if CSVeed could interpret null field values as empty, or offer an option to @CsvCell to enable that behavior.

A plausible workaround is to provide custom mappers for every field, but this is somewhat messy.