例如如何解析它?
{
"392bc124": {
"ts": {
"value": "File content"
},
"type": "File content",
"sn": "File content"
},
"07dba83e": {
"ts": {
"value": "File content"
},
"type": "File content",
"sn": "File content"
},
"a24faa33": {
"ts": {
"value": "File content"
},
"type": "File content",
"sn": "File content"
}
}
我知道它如何只与一个一起使用
{
"devices" : [
{
"name" : "07dba83e"
"sn" : "c8abddf44e49986ff2cd03be6fd2b1fc",
"type" : "output",
"value" : "100"
},
{
"name" : "392bc124"
"sn" : "644f2821b26a7d6c93720b26c5044b40",
"type" : "input",
"value" : "12"
},
{
"name" : "a24faa33"
"sn" : "2893a640fd1b6102c84f035c42ee4257",
"type" : "dimmer",
"value" : "0"
}
]
}
如果我不知道名称(“392bc124”),我如何获得“392bc124”json对象?在第二个示例中,我有一个数组,可以,但我不知道,有什么方法可以解析第一个示例吗?
最佳答案
关于java - 是否可以在Java中使用org.json解析JSON文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5412470/