Support for getters of boolean variables
A fast, programmer-friendly, free CSV library for Java
Brought to you by:
jamesbassett,
kbg
Yes, I think this is a good feature. The CsvDozerBeanWriter already supports this (as Dozer does), but CsvBeanWriter doesn't.
Note that isX() is only valid for boolean/Boolean fields - we probably shouldn't match isX() accessors for all types (if somebody makes a typo on a field name, we really don't want the exception to say that it couldn't find isX() when the field might actually be a String/Integer).
Go for it :)
Ok, here's the patch. It's very small and it should work flawlessly :))
Awesome, thanks Vlad, it's good to see that feature implemented. I've applied the patch and added you as a contributor to the project :) I did end up modifying it a fair bit to make it more robust (ensuring there's a return type and no parameters on the getter).
I now realise why we didn't add it sooner - ideally we should also add support for isX() style boolean getters to BeanInterfaceProxy (if you read into an interface instead of a class), and that's a lot more complicated (particularly when there's getters returning primitives, which it doesn't support yet). But I'll raise a separate feature request for that, as it's probably not a widely used feature.
[r276]
Related
Commit: [r276]