Hi All,
I have below class :
class A
{
...
private HashMap hashMap = new HashMap();
...
// getter and setter methods for hashMap member variable
...
}
binding.xml
------------
<binding>
<mapping class="A" name="aClass">
...
<structure field="hashMap" />
...
</mapping>
<mapping class="java.util.HashMap" name="hash-map"
marshaller="org.jibx.extras.TypedArrayMapper"
unmarshaller="org.jibx.extras.TypedArrayMapper"></mapping>
</binding>
Below is the JiBX Client Code Client.java I am trying to run :
Client.java
----------------
IMarshallingContext mctx = bfact.createMarshallingContext();
A aObject = new A();
HashMap hashMap = new HashMap();
hashMap.put("a", new String("b"));
hashMap.put("c", new String("d"));
forecastObj.setHashMap(hashMap);
mctx.setIndent(4);
mctx.marshalDocument(aObject, "UTF-8", null, new FileOutputStream("data0.xml"));
I have 2 questions here:
1. When I run the above Client.java I am getting below runtime error :
Exception:null
2. Under what scenarios we use each of
org.jibx.extras.HashMapperStringToComplex,
org.jibx.extras.TypedArrayMapper,
org.jibx.extras.ObjectArrayMapper ?
Can anyone please help me and clear my doubts ?
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