Hello,

I have a class already written and I want to write a mapping.xml file for it
to enable marshalling/unmarshalling.

One of the properties of this class is myMap of type java.util.Map.

public Map getMyMap(){...}
public void setMyMap(Map m){...}

The keys in the map are all of type java.lang.String but the values in the
Map do not have a common base class other than java.lang.Object.  All the
possible types the map might hold are fixed and known at mapping.xml writing
time.

I'd like the myMap property to marshall/unmarshall to something like this.

<mymap>
   <onetype id="key1"> .....</onetype >  <!-- first object is type One -->
   <btype id="key3"> .....</btype>  <!-- 2nd object is type B -->
   <onetype id="key2"> .....</onetype > <!-- 3rd object is type One,
etc. -->
   ...
</mymap>

where the id attributes are the keys in the map.

Browsing  around the mapping.xml examples on the castor.org website, I did
not see an example of this.

Is this doable by the castor xml framework?  If so, what would the <field>
entry in the mapping.xml look like?

Regards,

-Brian

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to