Querying an arbitrary nested json in java
<p>I have trying since last couple of hours but am not able to get my head around this.</p>

<p>Basically, there are two things, a list and a json string:</p>

<pre><code>queryList = [ ["user"],["place",["city"]]
</code></pre>

<p>So this queryList contains the keys whose value I want to get from the following json.</p>

<p>Now the json string also contains the following keys:</p>

<pre><code>  json_string = {"user":"foo", "place": {"city":"foocity"}....}
</code></pre>

<p>since "city" is present in nested format, hence queryList has [city] which is a 2D member?</p>

<p>So manually, i can do something like:</p>

<pre><code>   json_string.get("user");
   json_string.getJSONObject("place").get("city");
</code></pre>

<p>But I dont want to hardcode them...
The output I am expecting is:</p>

<pre><code>  ["foo","foocity"]
</code></pre>

<p>I am new in java and hence having a hard time think straight in this.</p>

<p>Thanks</p>
