Given the following XML
<mappings>
<map>
<source srcAttr="oof">foo</source>
<target trgAttr="rab">bar</target>
</map>
<map>
...
Is it possible with JAXB to unmarshal the <map>
elements into a single class Map
containing values and attributes of <source>
and <target>
?
@XmlRootElement
class Map {
@XmlElement
String source;
@???
String srcAttr;
@XmlElement
String target;
@???
String trgAttr;
}
I don't want to create extra classes for Source and target.