Look at chapter 8 of the official javabeans spec.
And at the description (and implementation) of Introspector.decapitalize() (docs.oracle.com)
All uppercase property names (or at least the first two letters in uppercase) will be left alone. The property "file" will result in "getFile()", the property "URL" will result in "getURL()", the property "IDs" will result in "getIDs()".
This process is reversible, so from "getURL()" you get the property name "URL", from "getFile()" the property name "file", from "getIDs() you'll get the name "IDs".
The reversability is realized in Introspector.decapitalize().
One side effect, and this is where SuperCSV (as many other libraries) is wrong, is that property names such as "iPad" (i.e. only the second character is upper case) will result in "getiPad()", even if it looks unusual. SuperCSV looks for "getIPad()" and doesn't find it in a correctly defined java bean.
Compare your favorite IDE's (Eclipse, NetBeans, IntelliJ) "generate getters/setters" method which work that way.
Thanks Ulrich, you're totally right. We'll fix this in the next release.
any update? When can we expect the next release? I'm also seeing the same problem, and would really like to see this fixed asap.
org.supercsv.exception.SuperCsvReflectionException: unable to find method setnumber(java.lang.String)
Fixed in [r298].
CsvBeanReader/Writer now ignore the case of any getter/setter when looking for a match.
Related
Commit: [r298]