我有一个json对象:
{"Result":{"code":0,"description":"success"} ,
"Tickets":[{
"TicketDetails":[
{"Key":"tknum","Value":888},
{"Key":"tkDescription","Value":"test"},
],
"Requestor":[
{"Key":"name","Value":"abc"},
{"Key":"add","Value":"xyz"},
]
},
{
"TicketDetails":[
{"Key":"tknum","Value":333},
{"Key":"tkDescription","Value":"test1"},
],
"Requestor":[
{"Key":"name","Value":"abc2"},
{"Key":"add","Value":"xyz3"},
]
}
]
}
我不想使用JSON Parser。是否可以将此JSON直接读取到java pojo。 例如:
ObjectMapper mapper=new ObjectMapper();
TicketInfo info=mapper.readValue("above Json object",TicketInfo.class);