Hi !

I have been using XStream to convert from Java objects to JSON and vice
versa. I had a question and was hoping someone in this list can provide
some help/guidance. I have a Java object that has a HashMap as a member:

public class MyObject  {
    private HashMap<String, String> myMap = new ConcurrentHashMap();
}

I am trying to use XStream to serialize this object and the serialized
object using default XStream looks like the following:

{
"MyObject: : {
"myMap" : [ {"@class" : "java.util.ConcurrentHashMap", "id1" : "data"} ]
 }
}

I am looking for something like the following:

"MyObject" : {
"myMap" : {
"id1" : "data",
}
}

Essentially not treat the myMap object as a array and then adding the
object type data in the "class". I was looking at the mailing list; but I
haven't had much success. Any help would be really appreciated.

Venkatesh

Reply via email to