[Simple-support] model notation for example below
Brought to you by:
niallg
|
From: Arjan D. <arj...@gm...> - 2011-05-03 13:55:32
|
Hi All,
In my XML i got the following structure, but with everything i try to write
in the model, i keep getting nullpointerexceptions on the <feature>
How is <feature> being treated in this example? Element? List? Array?
something else?
<features>
<class-features>
<class-feature>
<name>Druid</name>
<feature>Proficiency: Armor, Light</feature>
<feature>Nature Sense</feature>
<feature>Spells</feature>
<feature>Proficiency: Armor, Medium</feature>
<feature>Wild Empathy (5+Cha.Mod)</feature>
<feature>Animal Companion</feature>
<feature>Druidic weapons</feature>
<feature>Proficiency: Shields</feature>
<feature>Spontaneous casting (Druid)</feature>
<feature>Secret Language: Druidic</feature>
<feature>Woodland Stride</feature>
<feature>Trackless Step</feature>
<feature>Resist Nature`s Lure</feature>
<feature>Wild Shape: 1x/day</feature>
<feature>Wild Shape (Small, Medium)</feature>
</class-feature>
</class-features>
</features>
Classes:
-------------------------------------------------------
ClassFeatures Class
-------------------------------------------------------
@Element(name="class-feature")
public class ClassFeatures {
@Element(name="name", required = false)
public String name;
@ElementList (name="feature", required= false)
public List<ClassFeatureList> feature;
}
-------------------------------------------------------
ClassFeatureList Class
-------------------------------------------------------
@Element(name="class-feature")
public class ClassFeatureList {
@Element(name="feature",required=false)
public String feature;
}
thanks
Arjan
|