title: Find value for a key from a dynamic json using java
body: <p>I need to get the value of the key from a dynamic json.<br>
  Input-> json Object, String key<br>
  Output-> json element(corresponds to the value of the key)<br>
  Example  </p>
  
  <p>JsonObject Jmsg = </p>
  
  <pre><code>{
    "id": "1753_CORE1",
    "name": "Gtx cuda Service:1753",
    "shortName": "gt-service-1753",
    "createdDate": "Mar 31, 2015 4:47:10 PM",
    "config": {
      "oauthSecret": [
        {
          "id": 45,
          "config123": {
            "oauthSecret": "P8n2x5Hsst0nFRRB0A",
            "status": "CREATED"
          },
          "SERVER132": "1000"
        },
        {
          "id": 46,
          "config123": {
            "oauthSecret": "P8n2x5Htss0nFRRB0A"
          },
          "SERVER132": "1000"
        }
      ],
      "oauthKey": "154284-service-1753",
      "SERVER": "1000"
    },
    "features": [
      9004,
      9005
    ]
  }
  </code></pre>
  
  <p>and String key = "status";<br>
  then
  JsonElement Jvalue = jsonGetValueformKey(Jmsg,key);<br>
  should return 'CREATED' in JsonElement or string type.</p>
  
  <p>if String key = "features";<br>
  then<br>
  JsonElement Jvalue = jsonGetValueformKey(Jmsg,key);<br>
  should return [9004,9005] in JsonElement or jsonArray type.  </p>
  
  <p>if key not found then return null<br>
  JsonObject Jmsg can be anything</p>