Re: [Simple-support] mapping map with nested lists
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2008-04-11 08:17:37
|
Hi,
Yes it is possible, however you will need more
metadata than the the typed map can provide so the
following will work.
private Map<String, AttributeList> attributeSets;
@Root
private class AttributeSet {
@ElementList(inline=true)
private List<String> attribute;
@Attribute
private String id;
public List<String> getList() {
return attribute;
}
}
Hope this helps.
Niall
--- Johannens Zillmann <JZ...@10...> wrote:
> Hi there,
>
> the framework looks great!
> I have following xml
> <attributeSets>
> <attributeSet id="set1">
> <attribute type="STRING">aString</attribute>
> <attribute type="LONG">124</attribute>
> </attributeSet>
> <attributeSet id="set2">
> <attribute type="STRING">a2ndString</attribute>
> </attributeSet>
> </attributeSets>
>
> I wonder if its possible to map this to a single map
> ?
> The mapKey should be the id attribute of
> attributeSet.
> The mapValue should be an List of Attribute objects.
> The signature looks like Map<String,
> List<Attribute>>
>
> So given this example xml the map would have to
> entries.
> The value of the first entry is a list of 2
> attributes.
> The value of the second is a list of 1 attribute.
>
> Is that possible ?
> Johannes
>
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 101tec GmbH
> Halle (Saale), Saxony-Anhalt, Germany
> http://www.101tec.com
>
> >
-------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008
> JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still
> time to save $100.
> Use priority code J8TL2D2.
>
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone>
_______________________________________________
> Simple-support mailing list
> Sim...@li...
>
https://lists.sourceforge.net/lists/listinfo/simple-support
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
|