Re: [Simple-support] How to reference attributes with path expression?
Brought to you by:
niallg
|
From: Rosczak, J. <Jan...@hl...> - 2011-08-02 12:40:43
|
Hi,
thanks a lot.
Would it be possible to have an equivalent to the "attribute" property of the ElementMap annotation on the ElementList annotation?
This would enable parsing an XML such as the following without the need of a helper class:
<specificationTable title="Field Descriptions" autoNumber="true">
<heading name="Label Name"/>
<heading name="Label Name 2"/>
<heading name="Label Name 3"/>
</specificationTable>
// Jan
P.S.: I could provide a patch if needed and desired
-----Original Message-----
From: Niall Gallagher [mailto:gal...@ya...]
Sent: Tuesday, August 02, 2011 1:33 PM
To: sim...@li...; Rosczak, Jan
Subject: Re: [Simple-support] How to reference attributes with path expression?
Hi,
Do this
@Path("heading")
@Attribute
private String name;
This will work.
Niall
--- On Tue, 2/8/11, Rosczak, Jan <Jan...@hl...> wrote:
> From: Rosczak, Jan <Jan...@hl...>
> Subject: [Simple-support] How to reference attributes with path expression?
> To: "sim...@li..." <sim...@li...>
> Received: Tuesday, 2 August, 2011, 3:33 AM
> Hello,
>
> I am just starting to work with the Simple framework and
> have a problem understanding the @Path annotation.
>
> My xml looks like:
>
> <specificationTable title="Field Descriptions"
> autoNumber="true">
> <heading name="Label Name"/>
> </specificationTable>
>
> Is this possible somehow:
> public class SpecificationTable {
> @Path(value = "heading/@name")
> private String heading;
> }
>
> If yes, would this work for more than one heading element,
> so could I annotate a list with it?
>
> Thanks in advance.
>
> Kind regards
>
>
> Jan Rosczak
> IT Architect
> Development Methods, Frameworks & Tools
> __________________________________
>
> Hapag-Lloyd AG
> Ballindamm 25
> D-20095 Hamburg
>
> Phone +49 (40) 3001- 2983
> Fax +49 (40)
> 3001- 2942
> Mail jan...@hl...
>
>
> http://www.hapag-lloyd.com
>
> Vorsitzender des Aufsichtsrats: Dr. Michael Frenzel
> Vorstand: Michael Behrendt (Vorsitzender), Peter Ganz,
> Ulrich Kranich, Jesper Praestensgaard
> Sitz: Hamburg, Handelsregister: Amtsgericht Hamburg HRB
> 97937
>
> Chairman of the Supervisory Board: Dr. Michael Frenzel
> Executive Board: Michael Behrendt (Chairman), Peter Ganz,
> Ulrich Kranich, Jesper Praestensgaard Registered Seat:
> Hamburg, Company Register: Amtsgericht Hamburg HRB 97937
>
>
> ------------------------------------------------------------------------------
> BlackBerry® DevCon Americas, Oct. 18-20, San
> Francisco, CA
> The must-attend event for mobile developers. Connect with
> experts.
> Get tools for creating Super Apps. See the latest
> technologies.
> Sessions, hands-on labs, demos & much more. Register
> early & save!
> http://p.sf.net/sfu/rim-blackberry-1
> _______________________________________________
> Simple-support mailing list
> Sim...@li...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>
|