title: How to deserialize JSON into flat, Map-like structure?
body: <p>Have in mind that the JSON structure is not known before hand i.e. it is completely arbitrary, we only know that it is JSON format.</p>
  
  <p>For example,</p>
  
  <p>The following JSON</p>
  
  <pre><code>{
     "Port":
     {
         "@alias": "defaultHttp",
         "Enabled": "true",
         "Number": "10092",
         "Protocol": "http",
         "KeepAliveTimeout": "20000",
         "ThreadPool":
         {
             "@enabled": "false",
             "Max": "150",
             "ThreadPriority": "5"
         },
         "ExtendedProperties":
         {
             "Property":
             [                         
                 {
                     "@name": "connectionTimeout",
                     "$": "20000"
                 }
             ]
         }
     }
  }
  </code></pre>
  
  <p>Should be deserialized into Map-like structure having keys like (not all of the above included for brevity):</p>
  
  <pre><code>port[0].alias
  port[0].enabled
  port[0].extendedProperties.connectionTimeout
  port[0].threadPool.max
  </code></pre>
  
  <p>I am looking into Jackson currently, so there we have:</p>
  
  <pre><code>TypeReference&lt;HashMap&lt;String, Object&gt;&gt; typeRef = new TypeReference&lt;HashMap&lt;String, Object&gt;&gt;() {};
  Map&lt;String, String&gt; o = objectMapper.readValue(jsonString, typeRef);
  </code></pre>
  
  <p>However, the resulting Map instance is basically a Map of nested Maps:</p>
  
  <pre><code>{Port={@alias=diagnostics, Enabled=false, Type=DIAGNOSTIC, Number=10033, Protocol=JDWP, ExtendedProperties={Property={@name=suspend, $=n}}}}
  </code></pre>
  
  <p>While I need flat Map with flatten keys using "dot notation", like the above.</p>
  
  <p>I would rather not implement this myself, although at the moment I don't see any other way... </p>