title: Insert value into ObjectNode and return JsonNode in Jackson json library
body: <p>I am trying to insert a value into a json object in the following format and save it to the database.</p>
  
  <pre><code>  {
          "mainObject": {
              "childObject1": {
                  "validator": {
                      "dataType": "TEXT",
                      "regEx": "^[a-zA-Z0-9_]*{3,10}$"
                  },
                  "input": "Enter data value here"
              },
              "childObject2": {
                  "validator": {
                      "dataType": "TEXT",
                      "regEx": "^[a-zA-Z0-9_]*{3,10}$"
                  },
                  "input": "Enter data value here"
              }
          }
      }
  </code></pre>
  
  <p>I need to enter values in the tag where it says input. Something like this:</p>
  
  <pre><code>{
      "mainObject": {
          "childObject1": {
              "validator": {
                  "dataType": "TEXT",
                  "regEx": "^[a-zA-Z0-9_]*{3,10}$"
              },
              "input": "Input 1"
          },
          "childObject2": {
              "validator": {
                  "dataType": "TEXT",
                  "regEx": "^[a-zA-Z0-9_]*{3,10}$"
              },
              "input": "Input 2"
          }
      }
  }
  </code></pre>
  
  <p>I have tried the following code snippet in java.  I am able to insert data into the right node. </p>
  
  <pre><code>String output = "{
      \"mainObject\": {
          \"childObject1\": {
              \"validator\": {
                  \"dataType\": \"TEXT\",
                  \"regEx\": \"^[a-zA-Z0-9_]*{3,10}$\"
              },
              \"input\": \"Enter data value here\"
          },
          \"childObject2\": {
              \"validator\": {
                  \"dataType\": \"TEXT\",
                  \"regEx\": \"^[a-zA-Z0-9_]*{3,10}$\"
              },
              \"input\": \"Enter data value here\"
          }
      }
  }";
  ObjectMapper mapper = new ObjectMapper();
  JsonNode rootNode = mapper.readTree(output);
  ObjectNode newMetadata = (ObjectNode)  rootNode.path("mainObject").path("childObject1");
  newMetadata.put("inputValue", "Input 1");
  </code></pre>
  
  <p>My problem is how to update and write this back to the mainObject node. At the moment the child nodes input tag is updated with the value, i want to update the mainobject with this and save to database.</p>