我如何用 GSON 解析这个?因为这个以数字“1”和“2”开头。我已经为以 entity_id 开头的对象创建了一个对象,并且当我删除了外部 json(其中包含“1”)时它正在工作。
但我想解析这一大堆代码。那么我应该怎么做来解析“1”和“2”呢?像 String id 和 List innerobjects 之类的东西?
{
"1": {
"entity_id": "1",
"status": "complete",
"coupon_code": null,
"shipping_description": "Flat Rate - Fixed",
"customer_id": null,
"base_discount_amount": "0.0000",
"base_grand_total": "3422.3800",
"base_shipping_amount": "90.0000",
"base_shipping_tax_amount": "0.0000",
"base_subtotal": "3332.3800",
"base_tax_amount": "0.0000",
"base_total_paid": "3422.3800",
"base_total_refunded": null,
"discount_amount": "0.0000",
"grand_total": "3422.3700",
"shipping_amount": "90.0000",
"shipping_tax_amount": "0.0000",
"store_to_order_rate": "1.0000",
"subtotal": "3332.3700",
"tax_amount": "0.0000",
"total_paid": "3422.3700",
"total_refunded": null,
"base_shipping_discount_amount": "0.0000",
"base_subtotal_incl_tax": "3332.3800",
"base_total_due": "0.0000",
"shipping_discount_amount": "0.0000",
"subtotal_incl_tax": "3332.3700",
"total_due": "0.0000",
"increment_id": "100000001",
"base_currency_code": "EUR",
"discount_description": null,
"remote_ip": "472.15.1.83",
"store_currency_code": "EUR",
"store_name": "Main Website\nMain Website Store\nDefault Store View",
"created_at": "2012-08-10 09:37:17",
"shipping_incl_tax": "90.0000",
"payment_method": "checkmo",
"gift_message_from": null,
"gift_message_to": null,
"gift_message_body": null,
"tax_name": null,
"tax_rate": null,
},
"2": {
"entity_id": "2",
"status": "pending",
"coupon_code": null,
"shipping_description": "Flat Rate - Fixed",
"customer_id": null,
"base_discount_amount": "0.0000",
"base_grand_total": "1140.7900",
"base_shipping_amount": "30.0000",
"base_shipping_tax_amount": "0.0000",
"base_subtotal": "1110.7900",
"base_tax_amount": "0.0000",
"base_total_paid": null,
"base_total_refunded": null,
"discount_amount": "0.0000",
"grand_total": "1140.7900",
"shipping_amount": "30.0000",
"shipping_tax_amount": "0.0000",
"store_to_order_rate": "1.0000",
"subtotal": "1110.7900",
"tax_amount": "0.0000",
"total_paid": null,
"total_refunded": null,
"base_shipping_discount_amount": "0.0000",
"base_subtotal_incl_tax": "1110.7900",
"base_total_due": null,
"shipping_discount_amount": "0.0000",
"subtotal_incl_tax": "1110.7900",
"total_due": null,
"increment_id": "100000002",
"base_currency_code": "EUR",
"discount_description": null,
"remote_ip": "182.11.7.52",
"store_currency_code": "EUR",
"store_name": "Main Website\nMain Website Store\nDefault Store View",
"created_at": "2012-08-15 15:19:35",
"shipping_incl_tax": "30.0000",
"payment_method": "checkmo",
"gift_message_from": null,
"gift_message_to": null,
"gift_message_body": null,
"tax_name": null,
"tax_rate": null,
}
}