title: How to get JSON element type with Gson?
body: <p>In a JSON file, each object inside the file is composed by different type of JSON elements. (integer, string, array, array of objects, etc.)</p>
  
  <p>My target is to list all element name and corresponding type. May I know how can I do that in Gson? The purpose of this is for creating a Hive schema.</p>
  
  <p>Example:</p>
  
  <pre><code>{
    "number": 1, 
    "ts": "1386848002", 
    "cmpg": [
      {
        "id": 476, 
        "mcp": 0, 
        "deals": [ ], 
        "cookie": "uid:123", 
        "bid": [
          {
            "bId": 0, 
            "status": "ZB", 
            "rmtchID": -1
          }
        ]
      }
    ]
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>number int,
  ts String,
  cmpg array&lt;map&lt;String, Object&gt;&gt; // not sure how to interpret this...
  </code></pre>