Hi,

I'm writing a custom converter to change the default JSON output of maps
from:

[["first", "value1"], ["second", "value2"]]

To:

{"first" : "value1", "second" : "value2"}

Writing the keys is no problem (startNode), but its string values (setValue)
never get enclosed by quotes, even if it contains characters that need to be
escaped to prevent breaking the JSON code. Adding them manually with
something like the following will leave the escape character in the result.

writer.setValue("\""+ var1 + "\"");

I'm using the JsonHierarchicalStreamDriver driver.

How do I overcome this problem?

Yours sincerely,

Age



--
View this message in context: 
http://xstream.10960.n7.nabble.com/Quotes-enclosed-JSON-strings-with-custom-converter-tp8391.html
Sent from the User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to