[
{
"projectName": "bingo-paas",
"appName": "bingo-devops",
"progType": "GENERAL",
"deployType": "CONTAINER",
"projectId": "p-19sn3n1sv66c0",
"progId": "g-19sn59o2m29e0",
"progName": "bingo-devops-console",
"packs": [
{
"packId": "k-19ssm5j5dc220",
"packCode": "bingo-devops-console",
"packUri": "registry.bingosoft.net/bingodevops/bingo-devops-console",
"packVersion": "latest",
"repo": {
"repoId": "r-1adnr9sbnshbo",
"repoName": "registry",
"repoType": "CONTAINER",
"repoUri": "http://registry.bingosoft.net",
"handler": {},
"projectName": "bingo-paas",
"credentialId": "d-1adnr9pusbmkp",
"repoServer": "http://registry.bingosoft.net",
"hibernateLazyInitializer": {},
"projectId": "p-19sn3n1sv66c0",
"credentialName": "paas_app_ecr"
},
"progId": "g-19sn59o2m29e0",
"appId": "a-19sn3okvsq0i0"
}
],
"appId": "a-19sn3okvsq0i0",
"createdOn": "2018-02-25 02:21:57",
"createdBy": "308b29c4-3f5b-4a3d-9d5b-4e41ae4dda81",
"createdByName": "李强"
},
{
"projectName": "bingo-paas",
"appName": "bingo-devops",
"progType": "GENERAL",
"deployType": "CONTAINER",
"projectId": "p-19sn3n1sv66c0",
"progId": "g-19ta9di7jmpq0",
"progName": "bingo-devops-agent",
"packs": [
{
"packId": "gp-19tmlpje1inrc",
"packCode": "bingo-devops-agent",
"packUri": "registry.bingosoft.net/bingodevops/bingo-devops-agent",
"packVersion": "latest",
"repo": {
"repoId": "r-1adnr9sbnshbo",
"repoName": "registry",
"repoType": "CONTAINER",
"repoUri": "http://registry.bingosoft.net",
"handler": {},
"projectName": "bingo-paas",
"credentialId": "d-1adnr9pusbmkp",
"repoServer": "http://registry.bingosoft.net",
"hibernateLazyInitializer": {},
"projectId": "p-19sn3n1sv66c0",
"credentialName": "paas_app_ecr"
},
"progId": "g-19ta9di7jmpq0",
"appId": "a-19sn3okvsq0i0"
}
],
"appId": "a-19sn3okvsq0i0",
"createdOn": "2018-02-25 02:21:57",
"createdBy": "308b29c4-3f5b-4a3d-9d5b-4e41ae4dda81",
"createdByName": "李强"
}
]
1 回答
pardon110
TA贡献1038条经验 获得超227个赞
需要用到json相关的jar包,可以用库的,也可以用阿里的fastjson
遍历json数组简单示例如下
// 一个未转化的字符串 String str = "[{name:'a',value:'aa'},{name:'b',value:'bb'},{name:'c',value:'cc'},{name:'d',value:'dd'}]" ; // 首先把字符串转成 JSONArray 对象 JSONArray json = JSONArray.fromObject(str ); if(json.size()>0){ for(int i=0;i<json.size();i++){ // 遍历 jsonarray 数组,把每一个对象转成 json 对象 JSONObject job = json.getJSONObject(i); // 得到 每个对象中的属性值 System.out.println(job.get("name")+"=") ; }
添加回答
举报
0/150
提交
取消