title: Extracting content from a nested json
body: <p>I am trying to used the gson library to parse a json file.I want to get a list of names and URLs of all states within a JSON.I am not able to understand the structure of the json object and how to retrieve this data,since any structure i create is returning null values . The sample structure of the JSON is</p>
  
  <pre><code>{
    "states" : {
      "state53" : {
        "name" : "state53",
        "url" : "http://cv4a.org/veterans-group-calls-accountability-va-funds-boost/",
        "candidateElements" : [ {
          "top" : 202,
          "left" : 58,
          "xpath" : "/HTML[1]/BODY[1]/DIV[2]/DIV[1]/DIV[2]/DIV[1]/ARTICLE[1]/HEADER[1]/P[1]/A[1]",
          "width" : 135,
          "height" : 20
        }, {
          "top" : 1307,
          "left" : 225,
          "xpath" : "/HTML[1]/BODY[1]/DIV[2]/DIV[1]/DIV[2]/DIV[1]/OL[1]/LI[1]/ARTICLE[1]/HEADER[1]/TIME[1]/A[1]",
          "width" : 191,
          "height" : 22
        }, {
          "top" : 1374,
          "left" : 912,
          "xpath" : "/HTML[1]/BODY[1]/DIV[2]/DIV[1]/DIV[2]/DIV[1]/OL[1]/LI[1]/ARTICLE[1]/A[1]",
          "width" : 78,
          "height" : 38
        }, {
          "top" : 0,
          "left" : 0,
          "xpath" : "/HTML[1]/BODY[1]/DIV[2]/DIV[1]/DIV[2]/DIV[1]/SECTION[1]/DIV[1]/P[1]/A[1]",
          "width" : 169,
          "height" : 18
        } ],
        "fanIn" : 1,
        "fanOut" : 3,
        "id" : 53,
        "failedEvents" : [ "xpath /HTML[1]/BODY[1]/DIV[2]/DIV[1]/DIV[2]/DIV[1]/SECTION[1]/DIV[1]/P[1]/A[1]" ]
      },
      "state9" : {
        "name" : "state9",
        "url" : "http://cv4a.org/blog/#",
        "candidateElements" : [ ],
        "fanIn" : 1,
        "fanOut" : 0,
        "id" : 9,
        "failedEvents" : [ ]
      },
  </code></pre>