title: How to ignore empty Objects "{}" but not empty Strings in ObjectMapper?
body: <p>I need to serialize (ignoring empty objects ("{}")) non-structured object which can have any content.</p>
  
  <p>From version 2.9.X FasterXML have changed logic of it work for (Include.NON_EMPTY).
  In older version it had worked as I need.
  But now it is ignoring empty strings too.</p>
  
  <pre class="lang-java prettyprint-override"><code>ObjectMapper mapper = new ObjectMapper();
  mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
  mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
  </code></pre>
  
  <p>Lets suppose that we have next java object (for convenience it will look like a JSON): </p>
  
  <pre><code>{
      "mapA": {},
      "listA": ["",
          {
              "emptyString": "",
              "string": "some text"
          },
          {}
      ],
      "emptyString": "",
      "mapB": {
          "emptyString": "",
          "mapC": {}
      }
  }
  </code></pre>
  
  <p>Converting it to JsonNode:</p>
  
  <pre><code>   mapper.convertValue(/*our Object*/, JsonNode.class);
  </code></pre>
  
  <p>Desired output(Again for convenience it will look like a JSON):</p>
  
  <pre><code>{
      "listA": ["",
          {
              "emptyString": "",
              "string": "some text"
          }
      ],
      "emptyString": "",
      "mapB": {
          "emptyString": ""
      }
  }
  </code></pre>