[Simple-support] ElementMap question
Brought to you by:
niallg
|
From: Micah J. <mi...@af...> - 2008-06-23 21:37:56
|
I have an ElementMap that I'm declaring as such:
@ElementMap(entry="foo", key="level", attribute=true, inline=true)
private HashMap<Integer, Foo> map = new HashMap<Integer, Foo>();
private static class Foo
{
@Attribute(required=false)
private String attr1;
@Attribute(required=false)
private String attr2;
@Text
private String value;
}
The goal would be to be able to read XML like this:
<foo level="0" attr1="abc">value1</foo>
<foo level="1" attr2="xyz">value2</foo>
<foo level="3" attr1="123">value3</foo>
When testing the code it seems to pull out the key information
correctly, but is setting every value of Foo in the HashMap to null.
The goal is to be able to retrieve an object from this map that will
always be keyed off "level", and have N number of attributes (meta
data) which are optional, and only a single value.
What am I doing wrong?
-Micah
|