The rules for property names are really pretty simple. They're explained in the JavaDoc for the java.beans.Introspector.decapitalize mehtod as well as in the JavaBeans Specification (Section 8.8 Capitalization of inferred names). As you might expect, the rules are actually codified in java.beans.Introspector.decapitalize. Here's a snippet from the Spec:

...we normally convert the first character to lower case. However to support the occasional use of all upper-case names, we check if the first two characters of the name are both upper case and if so leave it alone. So for example,

"FooBah" becomes "fooBah"

"Z" becomes "z"

"URL" becomes "URL"

We provide a method Introspector.decapitalize which implements this conversion rule.

  • No labels