Hi,

I have below java class :

public class Forecast
{
        ...
        private HashMap hashMap;
        ...
        // usual getter and setter methods for hashMap
        ...
}


Now I am having below binding definition :
        
<binding>
        <mapping class="Forecast" name="forecast">
                <value name="state" field="state" usage="optional"/>
                <value name="zip" field="zip" usage="optional"/>
                <value name="precip" field="precip" usage="optional"/>
                <value name="date" field="date" usage="optional"/>
                <value name="hi" field="hi" usage="optional"/>
                <value name="city" field="city" usage="optional"/>
                <value name="forecast" field="forecast" usage="optional"/>
                <value name="low" field="low" usage="optional"/>
                
                <structure field="temp" name="temperature" >
                        <value name="temp" field="temp" />
                </structure>
                
                <structure field="hashMap" />
                
                <collection field="dummyVector" usage="optional">
                        <value style="element" name="vectorElement" />
                </collection>           
        </mapping>

        <mapping name="customer" class="Customer" >
               <value name="street" field="street" />
               <value name="city" field="city" />
               <value name="state" field="state"/>
               <value name="zip" field="zip"/>
        </mapping>
        
        <mapping class="java.util.HashMap" name="map"
marshaller="org.jibx.extras.HashMapperStringToComplex"
unmarshaller="org.jibx.extras.HashMapperStringToComplex"/>
</binding>


I can un(marshal) HashMap's that can contain key as java.lang.String
and value as Customer object but my doubts  are below:

1. how to handle HashMap's containing java.lang.String as value ? Do
we need to define a binding for java.lang.String ?
2. how to handle HashMap's contain Customer object as key or say
java.lang.Integer as key ?


I dont find answers in JiBX tutorials relate to my above questions.
Please suggest ...



Thanks & Regards,
Kumar.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to