-2
我有JSON字符串,它可能不是正確的形式。但是,我需要把它映射到Java對象:喜歡StockTransaction,StockTransactionDetail,StockTransactionSerial多維json字符串到對象
{
"STOCK_TRANSACTION": [
{
"STOCK_ID" : "1", "DELIVERER_STOCK_ID": "1", "TYPE ":"1", "REASON_ID":"1", "STATUS":"1", "NOTE":"1", "GET_FROM_STOCK_TRANS_ID" : "1",
"TRANSACTION_ACTION": [{"ACTION_CODE":"1", "TYPE": "1", "STATUS" : "1", "NOTE":"1", "USERNAME":"1", "ACTION_STAFF_ID":"1" }],
"STOCK_TRANSACTION_DETAIL" :
[
{"GOODS_ID":"1", "STATE_ID":"1", "QUANTITY":"1", "PRICE":"1", "NOTE":"1", "TYPE":"1", "GOODS_STATUS":"1", "INTERNAL_STOCK_ID":"1",
"STOCK_TRANSACTION_SERIAL":
[
{"FROM_SERIAL":"1", "TO_SERIAL":"1", "QUANTITY":"1", "INTERNAL_STOCK_ID":"INTERNAL_STOCK_ID"}
{"FROM_SERIAL":"1", "TO_SERIAL":"1", "QUANTITY":"1", "INTERNAL_STOCK_ID":"INTERNAL_STOCK_ID"}
]}
{"GOODS_ID":"1", "STATE_ID":"1", "QUANTITY":"1", "PRICE":"1", "NOTE":"1", "TYPE":"1", "GOODS_STATUS":"1", "INTERNAL_STOCK_ID":"1",
"STOCK_TRANSACTION_SERIAL":
[
{"FROM_SERIAL":"1", "TO_SERIAL":"1", "QUANTITY":"1", "INTERNAL_STOCK_ID":"INTERNAL_STOCK_ID"}
{"FROM_SERIAL":"1", "TO_SERIAL":"1", "QUANTITY":"1", "INTERNAL_STOCK_ID":"INTERNAL_STOCK_ID"}
]}
]
}
]
}
你嘗試過這麼遠嗎?您是否搜索了現有的相關問題? – reto
你的問題不是很清楚。你想實現什麼? – 2014-01-23 07:17:19
你可以使用JSONArray對象爲該http://stackoverflow.com/questions/21019131/read-json-file-and-display-its-contents/21019227#21019227 –