我可以使用任何api将json转换为java对象吗?
{
"trigger":
{
"name": "new user2",
"input":
{
"auth": "EaIv0NlXiDWJrpvLkAdP",
"domain": "rangersrockerz"
}
}
}
答案 0 :(得分:-1)
JsonObject inputObject=new JsonObject();
JsonObject triggerObject=new JsonObject();
JsonObject mainObject=new JsonObject();
try{
inputObject.put("auth","EaIv0NlXiDWJrpvLkAdP");
inputObject.put("domain","rangersrockerz");
triggerObject.put("input",inputObject);
triggerObject.put("name","new user2");
mainObject.put("trigger",triggerObject);
} catch(Exception e){
}