commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Baltz, Kenneth" <Kba...@firstam.com>
Subject RE: [Digester] SetPropertiesRule
Date Fri, 14 Feb 2003 23:52:39 GMT
Just a follow up, it appears that the rule when the first two letters are
capitalized is to leave the name alone.  Look at
java.beans.Introspector.decapitalize() in the JDK JavaDoc.

K.C.

> -----Original Message-----
> From: Craig R. McClanahan [mailto:craigmcc@apache.org]
> Sent: Friday, February 14, 2003 3:28 PM
> To: Jakarta Commons Users List
> Subject: Re: [Digester] SetPropertiesRule
> 
> 
> 
> 
> On Fri, 14 Feb 2003, Durham David Cntr 805CSS/SCBE wrote:
> 
> > Date: Fri, 14 Feb 2003 15:57:28 -0600
> > From: Durham David Cntr 805CSS/SCBE <David.Durham1@scott.af.mil>
> > Reply-To: Jakarta Commons Users List 
> <commons-user@jakarta.apache.org>
> > To: commons-user@jakarta.apache.org
> > Subject: [Digester] SetPropertiesRule
> >
> > Having a problem with digester.setProperties(String).
> >
> > I have the following xml doc:
> >
> > <root>
> >     <element xOffset="squadron"/>
> > </root>
> >
> >
> > The property does not get set in the bean unless the "x" in 
> xOffset is
> > capitalized, i.e., "XOffset" which doesn't seem right.
> >
> > Is this a bug?
> >
> 
> No, it's not.  Welcome to the wonderful world of the 
> JavaBeans rules on
> converting property names to getter and setter method names.
> 
> Normally, property names are expressed in "mixedCase" style, 
> starting with
> a lower case letter, and this would get converted into a call on a
> setMixedCase() method.  For property names where the 
> getter/setter method
> is all upper case (i.e. getURL/setURL), there are some 
> special rules; this
> is also true when the first capital is in the second position 
> (as it is in
> your case).
> 
> The details of the naming patterns are in the JavaBeans Specification,
> which you can get from:
> 
>   http://java.sun.com/products/javabeans/
> 
> Craig
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message