title: How to get value in JSON array Using GSON
body: <p>i want to know select value in JSON array.</p>
  
  <p>my JSON is</p>
  
  <pre><code>{
    "meta": {
      "is_end": true,
      "total_count": 1,
      "pageable_count": 1
    },
    "documents": [
      {
        "road_address": {
          "undergroun_yn": "N",
          "road_name": "충대로",
          "underground_yn": "N",
          "region_2depth_name": "청주시 서원구",
          "zone_no": "28644",
          "sub_building_no": "",
          "region_3depth_name": "개신동",
          "main_building_no": "1",
          "address_name": "충북 청주시 서원구 충대로 1",
          "y": "36.63003935314667",
          "x": "127.45479196889647",
          "region_1depth_name": "충북",
          "building_name": "충북대학교"
        },
        "address_name": "충북 청주시 서원구 충대로 1",
        "address": {
          "b_code": "4311210900",
          "region_3depth_h_name": "성화.개신.죽림동",
          "main_address_no": "12",
          "h_code": "4311259000",
          "region_2depth_name": "청주시 서원구",
          "main_adderss_no": "12",
          "sub_address_no": "",
          "region_3depth_name": "개신동",
          "address_name": "충북 청주시 서원구 개신동 12",
          "y": "36.6284039605616",
          "x": "127.45921419389084",
          "mountain_yn": "N",
          "zip_code": "361763",
          "region_1depth_name": "충북",
          "sub_adderss_no": ""
        },
        "y": "36.63003935314667",
        "x": "127.45479196889647",
        "address_type": "ROAD_ADDR"
      }
    ]
  }
  </code></pre>
  
  <p>but, this code error is occurred that say "<strong>java.lang.IllegalStateException: Not a JSON Object"</strong>
  so, i try to solve them and search many way.
  i don't using a part of 'meta' only using 'documents' in JSON.
  than, i write the java code.
  my original code is</p>
  
  <pre><code>JsonElement jsonElement = parser.parse(html.toString()).getAsJsonObject();
  JsonObject rootObj = jsonElement.getAsJsonObject();
  
  
          JsonObject element = rootObj.get("documents").getAsJsonObject();
          String y = element.getAsJsonObject().get("x").toString();
          String x = element.getAsJsonObject().get("y").toString();
  
          System.out.println(y);
          System.out.println(x);
          System.out.println(html.toString());
          return html.toString();
  </code></pre>
  
  <p>and i knew "documents" is JSON array so, i revise my code.
  my revised java code is</p>
  
  <pre><code>    JsonElement jsonElement = parser.parse(html.toString()).getAsJsonObject();
      JsonObject rootObj = jsonElement.getAsJsonObject();
      String y = rootObj.getAsJsonArray().get(Integer.parseInt("x")).toString();
      String x = rootObj.getAsJsonArray().get(Integer.parseInt("y")).toString();
  
          System.out.println(y);
          System.out.println(x);
          System.out.println(html.toString());
          return html.toString();
  </code></pre>
  
  <p>but also error is occurred that say "<strong>java.lang.IllegalStateException: Not a JSON Array</strong>"
  i want to get result like</p>
  
  <pre><code>{
  "documents": [
          {
            "road_address": {
              "undergroun_yn": "N",
              "road_name": "충대로",
              "underground_yn": "N",
              "region_2depth_name": "청주시 서원구",
              "zone_no": "28644",
              "sub_building_no": "",
              "region_3depth_name": "개신동",
              "main_building_no": "1",
              "address_name": "충북 청주시 서원구 충대로 1",
              "y": "36.63003935314667",
              "x": "127.45479196889647",
              "region_1depth_name": "충북",
              "building_name": "충북대학교"
            },
            "address_name": "충북 청주시 서원구 충대로 1",
            "address": {
              "b_code": "4311210900",
              "region_3depth_h_name": "성화.개신.죽림동",
              "main_address_no": "12",
              "h_code": "4311259000",
              "region_2depth_name": "청주시 서원구",
              "main_adderss_no": "12",
              "sub_address_no": "",
              "region_3depth_name": "개신동",
              "address_name": "충북 청주시 서원구 개신동 12",
              "y": "36.6284039605616",
              "x": "127.45921419389084",
              "mountain_yn": "N",
              "zip_code": "361763",
              "region_1depth_name": "충북",
              "sub_adderss_no": ""
            },
            "y": "36.63003935314667",
            "x": "127.45479196889647",
            "address_type": "ROAD_ADDR"
          }
        ]
      }
  }
  </code></pre>
  
  <p>and get key "x","y" and those values 
  but, the error is continously occured.
  how to solve them? </p>