You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by de...@struts.apache.org on 2004/09/21 20:29:13 UTC

[Apache Struts Wiki] New: BeanPropertyNames

   Date: 2004-09-21T11:29:13
   Editor: KrisSchneider <kr...@dotech.com>
   Wiki: Apache Struts Wiki
   Page: BeanPropertyNames
   URL: http://wiki.apache.org/struts/BeanPropertyNames

   no comment

New Page:

##language:en
#pragma section-numbers off

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:

...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 provide a method Introspector.decapitalize which implements this conversion rule.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org