If bindy fails to parse a value, say a date, an exception is thrown and the entire unmarshal operation is aborted. It would be nice if the exception could be handled and processing could resume. We'd probably also want a way to specify a default value in the case of a parse failure.
Here are some choices that need to be made:
- A way to indicate unmarshaling should resume in the event of a parse failure. Where would this live? Options are at the component option level, @CsvRecord level, and @DataField level. Maybe all of these with each one successively overriding the higher level setting. But maybe that's too complex. What would this be called? continueOnParseFailure? Is this even the right concept?
- A way to specify a default value to use when a parse fails. @DataField already has a defaultValue element, so maybe we use this value in the event of a failure. If defaultValue is not set, it could default to null or the default value for a primitive type.