首页 > 解决方案 > 如何处理 JSON OBJECT,其中不知道对象的编号及其键名

问题描述

我有一个带有键“propertyInformation”的 Json 对象,并且该对象的用户有许多具有不同值的 Json 对象,将来可能会更改 Json 对象的名称或添加新的 Json 对象。我的问题是如何解析该类型的 JSON 以及在屏幕上显示此数据的最佳方式是什么。我的 JSON 如下所示,但将来可能会更改。

      {
          "Description": "You'll enjoy sitting on the front porch in the morning watching the sun come up while the many species of birds chirp and play. Inside features include Spanish tile in the living room, vaulted beam ceiling and stone fireplace. The master suite is enormous with enough room for a sitting area or office. There's also a window seat. Skylight in the guest bath for natural lighting. The large back patio and yard are great for entertaining, gardening or gathering pecans from the large pecan tree!",
          "MLS": "2649472",
          "Address": "802 Stillhouse SPG",
          "Lat": "30.51567",
          "Lng": "-97.73521",
          "NumberBathsTotal": "2",
          "NumberBedsTotal": "4",
          "Area": "RRW",
          "YearBuilt": "1979",
          "isFavourite": true,
          "propertyInformation": {
              "Essential Information": {
                  "MLS®#": "2649472",
                  "Price": "230000",
                  "Area": "RRW",
                  "Acres": "0.269",
                  "All Baths": "2",
                  "Full Baths": "2",
                  "Half Baths": "0",
                  "Total Beds": "4",
                  "Type": "Residential",
                  "SubType": "House",
                  "Status": "Active"
              },
              "Community Information": {
                  "Address": "802 Stillhouse SPG",
                  "City": "Round Rock",
                  "State": "TX",
                  "Zipcode": "78681",
                  "County": "Williamson",
                  "PID": "16346500060015",
                  "Sub Div": "Brushy Creek Sec 01 Or South"
              },
              "Amenities": {
                  "Address": "Electricity on Property, Natural Gas on Property",
                  "Number of Garage": "0",
                  "View": "No View",
                  "Fence": "Wood"
              },
              "Interior Information": {
                  "Interior Features": "Ceiling-Beam, Ceiling-Vaulted",
                  "Kitchen": "Galley Type",
                  "Appliances": "Dishwasher, Disposal, Microwave Oven, Range-Free Standing",
                  "Pool on Property": "No",
                  "Sprinkler System": "No",
                  "Rooms": "Converted Garage",
                  "Heating": "Central Heat",
                  "AC": "Central Air"
              },
              "Exterior Information": {
                  "Exterior Features": "Curbs, Deck, Outbuildings, Patio-Covered, Sidewalk",
                  "Roof": "Composition Shingle",
                  "Appliances": "Dishwasher, Disposal, Microwave Oven, Range-Free Standing",
                  "Number of Stories": "1",
                  "Number of Living": "1",
                  "Construction": "3 Side Masonry",
                  "Flooring": "Carpet, Linoleum, Tile - Hard"
              },
              "School Information": {
                  "School District": "Round Rock ISD",
                  "Elementary School": "Brushy Creek",
                  "Middle School": "Cedar Valley",
                  "High School": "McNeil"
              },
              "Tax Information": {
                  "Estimated Taxes": "5733",
                  "Tax Year": "2017",
                  "Tax Rate": "2.5",
                  "HoaFee": "$300 \/ Annually"
              },
              "Extra Information": {
                  "Legal Description": "BRUSHY CREEK SEC 1 (OR SOUTH), BLOCK 6, LOT 15",
                   "Address": "Fee-Simple",
                   "Square Foot Total": "1900",
                   "Square Foot Price": "Owner",
                   "Per Sqft Price": "121.05",
                   "Master Main": "Yes",
                   "Flood Plain": "No",
                   "Master Desc": "Full Bath",
                   "Sewer": "MUD",
                   "Water Source": "MUD"
               }
          }
     } 

标签: androidjson

解决方案


推荐阅读