commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mohan Kishore <mohankish...@yahoo.com>
Subject Re: [beanutils] Uppercased PropertiyDescriptor
Date Fri, 11 Apr 2003 19:00:18 GMT
Just to complete the discussion, an excerpt from the JavaBeans1.0.1 spec (which
explains the behaviour you just reported):

<snip>
when we extract a property or event name from the middle of an existing Java
name, 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.
</snip>

--- Sandra Mema <threedimme@yahoo.de> wrote:
> Ok. Thanks:
> 
> I just got confused, because 
> 
> digester.addBeanPropertySetter("OrderList/Order/UserID",
>  "USER_street");
> 
> work for a setter setUSER_street(). That why I thought
> 
> it would aswell work for "UserID"
> 
> 
> 
> --- Mohan Kishore <mohankishore@yahoo.com> schrieb: >
> >
> >
> digester.addBeanPropertySetter("OrderList/Order/UserID","UserID");
> > Assuming your Order class has a method called
> > setUserID(String s), the above
> > line should be replaced by:
> >
> digester.addBeanPropertySetter("OrderList/Order/UserID",
> > "userID");
> > 
> > 
> > The algorithm is:
> > if you have a setter method setXyzAbc(String s) in
> > your class, you can 
> > 
> > 1) Have the xml element named xyzAbc and then use
> >
> digester.addBeanPropertySetter("PathTo/MyClass/xyzAbc");
> > 
> > OR
> > 2) Have the xml element named anything (say, MnoPqr)
> > and then use
> >
> digester.addBeanPropertySetter("PathTo/MyClass/MnoPqr","xyzAbc");
> > 
> > --- Sandra Mema <threedimme@yahoo.de> wrote:
> > > Well, actually I am
> > >
> >
>
using:digester.addObjectCreate("OrderList",com.benelog.upload.containers.OrderList.class);digester.addObjectCreate(
> > > "OrderList/Order",Order.class);          
> > >
> >
>
digester.addBeanPropertySetter("OrderList/Order/ID_Definition");digester.addBeanPropertySetter("OrderList/Order/UserID","UserID");That
> > > is what does not work. Looking the code
> > PropertyUtil,The "lowercased"
> > > PropertyDescriptors return by
> > getPropertyDescriptor (setName ---> name) seem
> > > not to be take into account in Digester for the
> > case of a "uppercased" tag
> > > ....Probably the bug, if I am right, should be
> > mended in Digester.do not
> > > know!
> > > 
> > > 
> > > ---------------------------------
> > > Gesendet von http://mail.yahoo.de.
> > > Privatkredit der DiBA: GŁnstige 7,5% Zinsen. Die
> > Alternative zum Dispo und
> > > genauso flexibel!
> > 
> > 
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Tax Center - File online, calculators, forms,
> > and more
> > http://tax.yahoo.com
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > commons-dev-help@jakarta.apache.org
> >  
> 
> __________________________________________________________________
> 
> Gesendet von Yahoo! Mail - http://mail.yahoo.de
> Bis zu 100 MB Speicher bei http://premiummail.yahoo.de
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com

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


Mime
View raw message