commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Anderson" <t...@intalio.com>
Subject RE: [betwixt][BUG?] Destreaming custom collections using Hyphenated/DecapitalizeNameMapper?
Date Sat, 14 Dec 2002 10:31:47 GMT
Attached is a junit test case which reproduces the problem.

Regards,

Tim

> -----Original Message-----
> From: Tim Anderson [mailto:tima@intalio.com]
> Sent: Saturday, December 14, 2002 7:50 PM
> To: commons-dev@jakarta.apache.org
> Subject: [betwixt][BUG?] Destreaming custom collections using
> Hyphenated/DecapitalizeNameMapper?
>
>
> Hi people,
>     I am trying to destream some XML using betwixt into a class structure
> which looks like:
>
> public class Foos {
>     // manages a collection of Foo
>     public void addFoo(Foo foo) { ... }
>     public Iterator getFoos() { .... }
> }
>
> public class Foo {
>     // ...
>     public void setValue(String value) { ... }
>     public String getValue() { ...}
> }
>
> Using the DefaultNameMapper, this streams as:
>
> <Foos>
>   <foo value="a"/>
>   <foo value="b"/>
> </Foos>
>
> and destreams fine. However with the Hyphenated/DecapitalizeNameMappers,
> it doesn't destream correctly - the addFoo() method is not invoked.
> Streamed it looks like:
> <foos>
>   <foo value="a"/>
>   <foo value="b"/>
> </foos>
>
> Looking at the debug trace, the following messages from XMLIntrospector
> appear:
> ....
> Processing child ElementDescriptor[qname=foos,pname=foos,class=interface
> java.util.Iterator,singular=class Foo,updater=MethodUpdater [method=public
> void Foos.addFoo(Foo)]]
>
> Creating generic rule for recursive elements
> ^^^^^^^^^^^^ problem starts here^^^^^^^^^^^^
>
> Created bean create rule
> Descriptor=ElementDescriptor[qname=foos,pname=foos,class=interface
> java.util.Iterator,singular=class Foo,updater=MethodUpdater [method=public
> void Foos.addFoo(org.apache.commons.sql.type.Foo)]]
> Class=class Foo Path prefix=*/foos
> Ignoring duplicate digester rule for path: */foos rule:
> BeanCreateRule [path
> prefix=*/foos
> descriptor=ElementDescriptor[qname=foos,pname=foos,class=interface
> java.util.Iterator, ....
>
> I'm configuring the introspector using:
>
>         introspector.setAttributesForPrimitives(true);
>         introspector.setWrapCollectionsInElement(false);
>         introspector.setElementNameMapper(new DecapitalizeNameMapper());
>
> Any ideas/workarounds?
>
> Thanks,
>
> Tim
>
>
> --
> To unsubscribe, e-mail:
> <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:commons-dev-help@jakarta.apache.org>
>

Mime
View raw message