我有一些来自服务器的JSON数据,我想用它来制作java bean。 有人可以帮忙吗?
"recent_data":{[
"data_number":<data NUMBER>,
"bill_number":"<BILLING NUMBER>"
"data_date":"<data DATE>",
"due_date":"<DUE DATE>",
"data_amount":{
"amount_exchanged":"<AMOUNT EXCHANGED>"
"amount_deducted":"<AMOUNT DEDUCTED>",
"amount":"<AMOUNT>"
},
"total_amount":"TOTAL AMOUNT>",
"total_discounts":"<TOTAL_ DISCOUNTS>",
"adjusted_amount":"<ADJUSTED AMOUNT>",
"data_type":"Normal",
"data_status":"Open"
]}
答案 0 :(得分:1)
您可以使用JSONObject来解析您的json字符串,并在需要时填充java bean(或者您可以直接使用JSONObject。
它有点冗长,但它内置于android。
答案 1 :(得分:1)
尝试Gson,它比JSONObject库更好。