Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to map arraylist containing a list of hashmaps using castor

radi ranga
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We want map an arraylist containing a list of hashmap using castor. We are mapping it as given below. With this mapping we are getting an arraylist containing hashmaps without any key/value pairs :( . Please help us in configuring the same.

[code]<class name="sample.ArrayListOfMaps">
<map-to xml="listofmaps" />
<field name="list" collection="arraylist" type="java.util.Map">
<bind-xml name="maps" node="element">
<class name="sample.SampleMap">
<map-to xml="mapItem" />
<field name="mapp" collection="map">
<bind-xml name="innerMap">
<class name="org.exolab.castor.mapping.MapItem">
<field name="key" type="java.lang.String">
<bind-xml name="id" node="attribute" />
<field name="value" type="java.lang.Object">
<bind-xml name="Item" node="element" />

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic