XML : JAXB Unmarshalling of XML into HashMap

I have a complex XML Structure as below which needs to be unmarshalled:

  <abc>        <pqr>          <attribute>name</attribute>          <entry>            <priorityKey>              <class>123</class>              <reason>abc</reason>            </prioritykey>            <priority> 1 </priority>          </entry>            <entry>            <prioritykey>              <class>456</class>              <reason>abc1</reason>            </prioritykey>            <priority>2</priority>          </entry>        </pqr>          <pqr>         '''         '''        </pqr>      </abc>    

abc is the root node. It can have multiple pqr elements. Each pqr element has one attribute node and multiple entry nodes. So I believe it will be of type HashMap(entry,attribute).

Each entry in turn has prioritykey and priority which I believe will be of type HashMap (prioritykey,priority).

Need to unmarshall this xml but not getting how to configure the XMLAdapter

No comments:

Post a Comment