Re: [Simple-support] Error when all elements have the same name
Brought to you by:
niallg
|
From: Arthur E. <ar...@bl...> - 2012-09-07 08:41:35
|
Thanks Niall that works great.
On Fri, Sep 7, 2012 at 12:11 AM, Niall Gallagher - Yieldbroker <
Nia...@yi...> wrote:
> I have fixed this in the SVN trunk, but have not released it. You can
> check it out, then it should work for you if you do ‘ant build’.****
>
> ** **
>
> *From:* Arthur Embleton [mailto:ar...@bl...]
> *Sent:* Friday, 7 September 2012 2:57 AM
> *To:* sim...@li...
> *Subject:* [Simple-support] Error when all elements have the same name****
>
> ** **
>
> I have some XML such as the following:****
>
> <rdr>
> <details>
>
> ****
>
> ** **
>
> ** **
>
> <detail>****
>
> <name>version</name>
> <value>15.0</value>****
>
> </detail>
> <detail>
> <name>resolution</name>****
>
> <value>1080X1920</value>
> </detail>
> <detail>
>
> ****
>
> ** **
>
> ** **
>
> <name>browser</name>****
>
> <value>Firefox</value>
> </detail>****
>
> </details>
> </rdr>****
>
>
> and I would like to map this to a bean so I have the following properties:
> ****
>
> @Path("details/detail[1]")
> @Element(name = "value")****
>
> private String version;
>
> @Path("details/detail[2]")
> @Element(name = "value")****
>
> private String resolution;
>
> @Path("details/detail[4]")
> @Element(name = "value")****
>
> private String browser;
>
> This results in a null pointer exception because they all have the same element names. InstantiatorBuilder.register(Label, Map) is putting a null as the value against any keys that are repeated.
>
> ****
>
> ** **
>
>
> What is the reasoning behind this?
>
> I commented this out and my code runs fine, but UnionWithSameNamesAndDifferentPathsTest.testErrorInParametersExample failed because "Ambiguous parameter should cause a failure". I can't understand what this test is trying to test!
>
> ****
>
> ** **
>
>
> ~
> Arthur****
>
>
|