title: how to iterate over hocon config object?
body: <p>I have following JSON,</p>
  
  <pre><code> {
      "child1-name" : {
          "child1child1-name" : "child1child1-value",
          "child1child2-name" : "child1child2-value"
      },
      "child2" : {
          "child2child1-name" : "child2child1-value"
      },
      "child3-name" : "child3-value"
  }
  </code></pre>
  
  <p>Now here As it is an HOCON config object i want to iterate over this and retrieve each element recursively.
  I want to iterate over each config object and based on its type (ArrayNode,ObjectNode,String etc) i will set appropriate value (comments) and return that node by setting final config object.</p>
  
  <p>I want to achieve following Pusedo Code :</p>
  
  <pre><code>  while(iterator.hasNext()) {
          Entry&lt;String, ConfigValue&gt; fld = iterator.next();
          // Now here access each object and value which will be of type of Configvalue
          //If(ConfigValueType.OBJECT)
               //set the required value 
         //else If(ConfigValueType.STRING)
                //set the required value 
  
      }
     //Once iteration done, set the new values in config and return final config object.
  </code></pre>
  
  <p>Following sample code i am thinking  of,</p>
  
  <pre><code>String jsonString = _mapper.writeValueAsString(jsonRoot); // jsonRoot is valid jsonNode object
         Config config = ConfigFactory.parseString(jsonString);
  
  //Now,  I want to set comments by iterating the config object.
  //I have gone through the following API’s,
  
  ConfigObject co = config.root();
          Set&lt;Entry&lt;String, ConfigValue&gt;&gt; configNode2 =co.entrySet();
  Iterator&lt;Entry&lt;String, ConfigValue&gt;&gt; itr =  configNode2.iterator();
          while(itr.hasNext()){
                Entry&lt;String, ConfigValue&gt; fld = itr.next();
                 // **how to set comments and return the config object** .
         }
  </code></pre>
  
  <p>The main reason to convert JSON to HOCON for me to set comments. Now in above code, I am not sure how to set the comments.</p>