Differences between revisions 1 and 2
Revision 1 as of 2005-03-22 05:48:36
Size: 892
Editor: anonymous
Comment: missing edit-log entry for this revision
Revision 2 as of 2009-09-20 23:11:49
Size: 894
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
The rules for property names are really pretty simple. They're explained in the Java``Doc for the {{{java.beans.Introspector.decapitalize}}} mehtod as well as in the [http://java.sun.com/products/javabeans/docs/spec.html 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: The rules for property names are really pretty simple. They're explained in the Java``Doc for the {{{java.beans.Introspector.decapitalize}}} mehtod as well as in the [[http://java.sun.com/products/javabeans/docs/spec.html|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:
Line 6: Line 6:
...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,[[BR]]
 "Foo``Bah" becomes "fooBah"[[BR]]
 "Z" becomes "z"[[BR]]
 "URL" becomes "URL"[[BR]]
...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,<<BR>>
 "Foo``Bah" becomes "fooBah"<<BR>>
 "Z" becomes "z"<<BR>>
 "URL" becomes "URL"<<BR>>

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.

BeanPropertyNames (last edited 2009-09-20 23:11:49 by localhost)