[Simple-support] populating ElementMap
Brought to you by:
niallg
|
From: bubbleguuum <bub...@fr...> - 2011-09-21 14:15:37
|
Give then following XML:
<devices>
<device udn="1">
<exported>
true
</exported>
</device>
<device udn="2">
<exported>
false
</exported>
</device>
</devices>
I want to populate a Map whose values are of type Device with:
@Root
public static class Device {
@Element(required = false)
private boolean exported;
public Device() {
}
}
The map is declared as:
@ElementMap(entry="device", key="udn", attribute=true)
private Map<String, Device> devices;
The result is Map containing 2 Device with correct key, but the devices
were not parsed (ie for the first one , exported is false).
I must be missing something obvious to achieve this ?
|