如何在Java中解析json格式的字符串
问题描述:
如何在Java中解析以下json字符串.我想一张一张地找回.
How to parse following json string in java. I would like to retrieve one by one.
{"IN1005*1001302*CWH":[{"qtyreceived":"5","itemcode":"1618306"},{"qtyreceived":"0","itemcode":"1618305"},{"qtyreceived":"0","itemcode":"288242"]}
Output can be
head=IN1005*1001302*CWH
qtyreceived=5
itemcode:1618306
以此类推
请任何人帮助我.我看到了很多示例,但没有一个与我的要求相匹配.如果您在其他旧帖子中找到了解决我问题的方法,请告诉我该帖子的详细信息和网址
Please any one help me . I saw many examples but none of them are matching with my requirement. If you found solution for my question in another old post please let me know the post details and url
答
You can achieve this using Jackson, see this Link
此处我的答案,将对象转换为json格式.
Here my answer for converting an object into json format.