commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <robertburrelldon...@blueyonder.co.uk>
Subject Re: betwixt - java.util.List read/write problems
Date Thu, 24 Apr 2003 18:58:04 GMT

On Monday, April 14, 2003, at 07:40 AM, Randall Lucas wrote:

>
> Hi Betwixters,
>
> I've discovered the source of the first issue I report below.
>
> The problem is in the capitalization of names, which appears to depend 
> upon the presence of an adder method for a collection property.
>
> When a List property exists with only getThings / setThings methods (no 
> addThing method), it appears that the constituents of the List are output 
> with capitalized names; in the example below, it would be:
>
> <Dataset>
>  <columns>
>   <Column />
>  </columns>
> </Dataset>
>
> However, adding the addThing method causes the output to become:
>
> <Dataset>
>  <columns>
>   <column />
>  </columns>
> </Dataset>
>
> (nb the "c" vs. "C" in the singular [c|C]olumn element)
>
> As may be obvious to the Betwixt dev team and experienced users, the 
> presence/absence of the wrapper element was moot (as long as the adder 
> method appeared in the base bean, things were fine either way).  Also, 
> only the top-level bean need be registered; registering the child bean 
> types (in this example, Column) is not necessary.  Write IDs is likewise 
> unrelated.
>
> This may be an expected outcome, but I think it more likely that there is 
> something in the XMLIntrospectionHelper and/or DefaultPluralStemmer which 
> begins non-adder-having, Collection property singulars with a capital 
> letter.

i think i can probably shed some light on this. without an adder method, 
the name of the class is used as the basis of the element name which is 
then processed further by an ElementNameMapper. the default 
ElementNameMapper does no processing and so you get a <Column> element. 
when an adder method is found, the property name is used and so you get 
<column>.

the cause of your initial problems was that betwixt currently requires an 
adder method to read a bean with a loop property. there are some wrinkles 
about adding support for normal setters (knowing what class should be 
created is one).

- robert


Mime
View raw message