You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Tim Anderson <ti...@intalio.com> on 2002/12/14 09:49:58 UTC

[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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [betwixt] DynaBeans

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
not sure :)

why not try it?

- robert

On Monday, December 16, 2002, at 10:02 PM, Robert wrote:

> Does betwixt support DynaBeans?
>
> --
> To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.
> org>
> For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.
> org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


[betwixt] DynaBeans

Posted by Robert <ro...@bull-enterprises.com>.
Does betwixt support DynaBeans?



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [betwixt][BUG?] Destreaming custom collections using Hyphenated/DecapitalizeNameMapper?

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
On Wednesday, December 18, 2002, at 10:52 AM, Tim Anderson wrote:

> Yup - that works thanks.

good.

> I guess I don't understand the semantics of <addDefaults/>.
> When is it required/not required?

this is what needs thinking about :)

AFAIK at the moment, there's no way to specify an updater for a property 
in the betwixt file but <addDefaults/> will add default updaters. probably 
the right way for things to work would be for there to be a way to specify 
updaters in the betwixt file and then <addDefaults/> would add default 
updaters for the default properties it adds.

unfortunately, this might require quite a bit of work.

- robert


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [betwixt][BUG?] Destreaming custom collections using Hyphenated/DecapitalizeNameMapper?

Posted by Tim Anderson <ti...@intalio.com>.
Yup - that works thanks.

I guess I don't understand the semantics of <addDefaults/>.
When is it required/not required?

Thanks,

Tim

> -----Original Message-----
> From: robert burrell donkin
> [mailto:robertburrelldonkin@blueyonder.co.uk]
> Sent: Wednesday, December 18, 2002 9:43 AM
> To: Jakarta Commons Developers List
> Subject: Re: [betwixt][BUG?] Destreaming custom collections using
> Hyphenated/DecapitalizeNameMapper?
>
>
> hi tim
>
> i know what the problem is. betwixt doesn't add updaters for methods
> unless a <addDefaults/> element is present. (if you can do this) adding a
> <addDefaults/> to your .betwixt file should be a temporary fix for the
> problem.
>
> i'm not going to alter the code so that betwixt adds updaters
> automatically since i think that the current behaviour is correct. but i
> will look into adding an 'updater' (or something like that) attribute to
> the 'element' element which will allow the matching updater to be
> specified in the betwixt file.
>
> - robert
>
> On Tuesday, December 17, 2002, at 08:54 AM, Tim Anderson wrote:
>
> > Thanks for the prompt response and patch Robert.
> >
> > This has highlighted another issue - if a .betwixt file
> > exists for the collection class, it doesn't destream.
> >
> > I need to specify a .betwixt file in order for my collection
> > class' contents to be streamed in the correct order.
> >
> > Attached is a .betwixt file for Elements.java, and a patch for
> > maven.xml to copy it to test-classes, to reproduce the problem.
> >
> > Thanks,
> >
> > Tim
> >
> >> -----Original Message-----
> >> From: robert burrell donkin
> >> [mailto:robertburrelldonkin@blueyonder.co.uk]
> >> Sent: Tuesday, December 17, 2002 9:02 AM
> >> To: Jakarta Commons Developers List
> >> Subject: Re: [betwixt][BUG?] Destreaming custom collections using
> >> Hyphenated/DecapitalizeNameMapper?
> >>
> >>
> >> i've committed a fix for this. if you get the chance, give it a try.
> >>
> >> thanks for the unit tests. it turned out to be to do with
> recognition of
> >> recursive elements rather than anything to do with the NameMapper
> >> implementations so i might have had difficulties replicate it
> otherwise.
> >>
> >> - robert
> >>
> >> On Sunday, December 15, 2002, at 11:13 PM, Tim Anderson wrote:
> >>
> >>> Go for it. I didn't include the license out of laziness ;)
> >>>
> >>>> -----Original Message-----
> >>>> From: robert burrell donkin
> >>>> [mailto:robertburrelldonkin@blueyonder.co.uk]
> >>>> Sent: Monday, December 16, 2002 3:34 AM
> >>>> To: Jakarta Commons Developers List
> >>>> Subject: Re: [betwixt][BUG?] Destreaming custom collections using
> >>>> Hyphenated/DecapitalizeNameMapper?
> >>>>
> >>>>
> >>>> thanks.
> >>>>
> >>>> those unit tests demonstrate the problem fine. fancy donating
> >> them to the
> >>>> apache software foundation (saves me writing equivalent ones)?
> >>>>
> >>>> (you didn't include the apache license at the top of each so i
> >> thought it
> >>>> best to check...)
> >>>>
> >>>> - robert
> >>>>
> >>>> On Saturday, December 14, 2002, at 10:31 AM, Tim Anderson wrote:
> >>>>
> >>>>> 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:
> >>>>>> <ma...@jakarta.apache.org>
> >>>>>> For additional commands, e-mail:
> >>>>>> <ma...@jakarta.apache.org>
> >>>>>>
> >>>>>    --
> >>>>> To unsubscribe, e-mail:
> >>>> <mailto:commons-dev-unsubscribe@jakarta.apache.
> >>>>> org>
> >>>>> For additional commands, e-mail:
> >>>> <mailto:commons-dev-help@jakarta.apache.
> >>>>> org>
> >>>>
> >>>>
> >>>> --
> >>>> To unsubscribe, e-mail:
> >>>> <ma...@jakarta.apache.org>
> >>>> For additional commands, e-mail:
> >>>> <ma...@jakarta.apache.org>
> >>>>
> >>>
> >>>
> >>> --
> >>> To unsubscribe, e-mail:
> > <mailto:commons-dev-unsubscribe@jakarta.apache.
> >> org>
> >> For additional commands, e-mail:
<mailto:commons-dev-help@jakarta.apache.
>> org>
>>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>   --
> To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.
> org>
> For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.
> org>


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [betwixt][BUG?] Destreaming custom collections using Hyphenated/DecapitalizeNameMapper?

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
hi tim

i know what the problem is. betwixt doesn't add updaters for methods 
unless a <addDefaults/> element is present. (if you can do this) adding a 
<addDefaults/> to your .betwixt file should be a temporary fix for the 
problem.

i'm not going to alter the code so that betwixt adds updaters 
automatically since i think that the current behaviour is correct. but i 
will look into adding an 'updater' (or something like that) attribute to 
the 'element' element which will allow the matching updater to be 
specified in the betwixt file.

- robert

On Tuesday, December 17, 2002, at 08:54 AM, Tim Anderson wrote:

> Thanks for the prompt response and patch Robert.
>
> This has highlighted another issue - if a .betwixt file
> exists for the collection class, it doesn't destream.
>
> I need to specify a .betwixt file in order for my collection
> class' contents to be streamed in the correct order.
>
> Attached is a .betwixt file for Elements.java, and a patch for
> maven.xml to copy it to test-classes, to reproduce the problem.
>
> Thanks,
>
> Tim
>
>> -----Original Message-----
>> From: robert burrell donkin
>> [mailto:robertburrelldonkin@blueyonder.co.uk]
>> Sent: Tuesday, December 17, 2002 9:02 AM
>> To: Jakarta Commons Developers List
>> Subject: Re: [betwixt][BUG?] Destreaming custom collections using
>> Hyphenated/DecapitalizeNameMapper?
>>
>>
>> i've committed a fix for this. if you get the chance, give it a try.
>>
>> thanks for the unit tests. it turned out to be to do with recognition of
>> recursive elements rather than anything to do with the NameMapper
>> implementations so i might have had difficulties replicate it otherwise.
>>
>> - robert
>>
>> On Sunday, December 15, 2002, at 11:13 PM, Tim Anderson wrote:
>>
>>> Go for it. I didn't include the license out of laziness ;)
>>>
>>>> -----Original Message-----
>>>> From: robert burrell donkin
>>>> [mailto:robertburrelldonkin@blueyonder.co.uk]
>>>> Sent: Monday, December 16, 2002 3:34 AM
>>>> To: Jakarta Commons Developers List
>>>> Subject: Re: [betwixt][BUG?] Destreaming custom collections using
>>>> Hyphenated/DecapitalizeNameMapper?
>>>>
>>>>
>>>> thanks.
>>>>
>>>> those unit tests demonstrate the problem fine. fancy donating
>> them to the
>>>> apache software foundation (saves me writing equivalent ones)?
>>>>
>>>> (you didn't include the apache license at the top of each so i
>> thought it
>>>> best to check...)
>>>>
>>>> - robert
>>>>
>>>> On Saturday, December 14, 2002, at 10:31 AM, Tim Anderson wrote:
>>>>
>>>>> 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:
>>>>>> <ma...@jakarta.apache.org>
>>>>>> For additional commands, e-mail:
>>>>>> <ma...@jakarta.apache.org>
>>>>>>
>>>>>    --
>>>>> To unsubscribe, e-mail:
>>>> <mailto:commons-dev-unsubscribe@jakarta.apache.
>>>>> org>
>>>>> For additional commands, e-mail:
>>>> <mailto:commons-dev-help@jakarta.apache.
>>>>> org>
>>>>
>>>>
>>>> --
>>>> To unsubscribe, e-mail:
>>>> <ma...@jakarta.apache.org>
>>>> For additional commands, e-mail:
>>>> <ma...@jakarta.apache.org>
>>>>
>>>
>>>
>>> --
>>> To unsubscribe, e-mail:
> <mailto:commons-dev-unsubscribe@jakarta.apache.
>> org>
>> For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.
>> org>
>>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>   --
> To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.
> org>
> For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.
> org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [betwixt][BUG?] Destreaming custom collections using Hyphenated/DecapitalizeNameMapper?

Posted by Tim Anderson <ti...@intalio.com>.
Thanks for the prompt response and patch Robert.

This has highlighted another issue - if a .betwixt file
exists for the collection class, it doesn't destream.

I need to specify a .betwixt file in order for my collection
class' contents to be streamed in the correct order.

Attached is a .betwixt file for Elements.java, and a patch for
maven.xml to copy it to test-classes, to reproduce the problem.

Thanks,

Tim

> -----Original Message-----
> From: robert burrell donkin
> [mailto:robertburrelldonkin@blueyonder.co.uk]
> Sent: Tuesday, December 17, 2002 9:02 AM
> To: Jakarta Commons Developers List
> Subject: Re: [betwixt][BUG?] Destreaming custom collections using
> Hyphenated/DecapitalizeNameMapper?
>
>
> i've committed a fix for this. if you get the chance, give it a try.
>
> thanks for the unit tests. it turned out to be to do with recognition of
> recursive elements rather than anything to do with the NameMapper
> implementations so i might have had difficulties replicate it otherwise.
>
> - robert
>
> On Sunday, December 15, 2002, at 11:13 PM, Tim Anderson wrote:
>
> > Go for it. I didn't include the license out of laziness ;)
> >
> >> -----Original Message-----
> >> From: robert burrell donkin
> >> [mailto:robertburrelldonkin@blueyonder.co.uk]
> >> Sent: Monday, December 16, 2002 3:34 AM
> >> To: Jakarta Commons Developers List
> >> Subject: Re: [betwixt][BUG?] Destreaming custom collections using
> >> Hyphenated/DecapitalizeNameMapper?
> >>
> >>
> >> thanks.
> >>
> >> those unit tests demonstrate the problem fine. fancy donating
> them to the
> >> apache software foundation (saves me writing equivalent ones)?
> >>
> >> (you didn't include the apache license at the top of each so i
> thought it
> >> best to check...)
> >>
> >> - robert
> >>
> >> On Saturday, December 14, 2002, at 10:31 AM, Tim Anderson wrote:
> >>
> >>> 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:
> >>>> <ma...@jakarta.apache.org>
> >>>> For additional commands, e-mail:
> >>>> <ma...@jakarta.apache.org>
> >>>>
> >>>    --
> >>> To unsubscribe, e-mail:
> >> <mailto:commons-dev-unsubscribe@jakarta.apache.
> >>> org>
> >>> For additional commands, e-mail:
> >> <mailto:commons-dev-help@jakarta.apache.
> >>> org>
> >>
> >>
> >> --
> >> To unsubscribe, e-mail:
> >> <ma...@jakarta.apache.org>
> >> For additional commands, e-mail:
> >> <ma...@jakarta.apache.org>
> >>
> >
> >
> > --
> > To unsubscribe, e-mail:
<mailto:commons-dev-unsubscribe@jakarta.apache.
> org>
> For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.
> org>
>


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>

Re: [betwixt][BUG?] Destreaming custom collections using Hyphenated/DecapitalizeNameMapper?

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
i've committed a fix for this. if you get the chance, give it a try.

thanks for the unit tests. it turned out to be to do with recognition of 
recursive elements rather than anything to do with the NameMapper 
implementations so i might have had difficulties replicate it otherwise.

- robert

On Sunday, December 15, 2002, at 11:13 PM, Tim Anderson wrote:

> Go for it. I didn't include the license out of laziness ;)
>
>> -----Original Message-----
>> From: robert burrell donkin
>> [mailto:robertburrelldonkin@blueyonder.co.uk]
>> Sent: Monday, December 16, 2002 3:34 AM
>> To: Jakarta Commons Developers List
>> Subject: Re: [betwixt][BUG?] Destreaming custom collections using
>> Hyphenated/DecapitalizeNameMapper?
>>
>>
>> thanks.
>>
>> those unit tests demonstrate the problem fine. fancy donating them to the
>> apache software foundation (saves me writing equivalent ones)?
>>
>> (you didn't include the apache license at the top of each so i thought it
>> best to check...)
>>
>> - robert
>>
>> On Saturday, December 14, 2002, at 10:31 AM, Tim Anderson wrote:
>>
>>> 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:
>>>> <ma...@jakarta.apache.org>
>>>> For additional commands, e-mail:
>>>> <ma...@jakarta.apache.org>
>>>>
>>>    --
>>> To unsubscribe, e-mail:
>> <mailto:commons-dev-unsubscribe@jakarta.apache.
>>> org>
>>> For additional commands, e-mail:
>> <mailto:commons-dev-help@jakarta.apache.
>>> org>
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail:
>> <ma...@jakarta.apache.org>
>>
>
>
> --
> To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.
> org>
> For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.
> org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [betwixt][BUG?] Destreaming custom collections using Hyphenated/DecapitalizeNameMapper?

Posted by Tim Anderson <ti...@intalio.com>.
Go for it. I didn't include the license out of laziness ;)

> -----Original Message-----
> From: robert burrell donkin
> [mailto:robertburrelldonkin@blueyonder.co.uk]
> Sent: Monday, December 16, 2002 3:34 AM
> To: Jakarta Commons Developers List
> Subject: Re: [betwixt][BUG?] Destreaming custom collections using
> Hyphenated/DecapitalizeNameMapper?
>
>
> thanks.
>
> those unit tests demonstrate the problem fine. fancy donating them to the
> apache software foundation (saves me writing equivalent ones)?
>
> (you didn't include the apache license at the top of each so i thought it
> best to check...)
>
> - robert
>
> On Saturday, December 14, 2002, at 10:31 AM, Tim Anderson wrote:
>
> > 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:
> >> <ma...@jakarta.apache.org>
> >> For additional commands, e-mail:
> >> <ma...@jakarta.apache.org>
> >>
> >    --
> > To unsubscribe, e-mail:
> <mailto:commons-dev-unsubscribe@jakarta.apache.
> > org>
> > For additional commands, e-mail:
> <mailto:commons-dev-help@jakarta.apache.
> > org>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [betwixt][BUG?] Destreaming custom collections using Hyphenated/DecapitalizeNameMapper?

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
thanks.

those unit tests demonstrate the problem fine. fancy donating them to the 
apache software foundation (saves me writing equivalent ones)?

(you didn't include the apache license at the top of each so i thought it 
best to check...)

- robert

On Saturday, December 14, 2002, at 10:31 AM, Tim Anderson wrote:

> 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:
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail:
>> <ma...@jakarta.apache.org>
>>
>    --
> To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.
> org>
> For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.
> org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [betwixt][BUG?] Destreaming custom collections using Hyphenated/DecapitalizeNameMapper?

Posted by Tim Anderson <ti...@intalio.com>.
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:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>