解析JSON并在Scala中迭代对象 [英] Parsing JSON and iterating through the object in Scala

查看:134
本文介绍了解析JSON并在Scala中迭代对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,给出以下JSON字符串:

Given, for example, the following JSON string:

[{"id": "user1", "password": "ps1"},{"id": "user2", "password": "ps2"},{"id": "user3", "password": "ps3"}]

什么是在Scala中解析它的最佳和最优化的方法,并迭代每个结果并正确分析它?

What's the best and most optimized way to parse it in Scala and iterate through every result and analise it properly?

谢谢。

推荐答案

我认为这篇博文提供了一个全面的答案: http://debasishg.blogspot.com/2011/02/applicatives-for -composable-json.html 最后还有一个指向完整源代码库的链接。

I think this blogpost gives an comprehensive answer to your question: http://debasishg.blogspot.com/2011/02/applicatives-for-composable-json.html at the end there is also a link to a full source repository.

这篇关于解析JSON并在Scala中迭代对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆