How to convert HashMap to JsonNode with Jackson?
<p>I have a <code>HashMap</code> object which I want to convert to <code>JsonNode</code> tree using <code>com.fasterxml.jackson.databind.ObjectMapper</code>. What is the best way to do it? </p>

<p>I found the following code but since I don't know the Jackson API well, I wonder if there are some better ways.</p>

<pre class="lang-java prettyprint-override"><code>mapper.reader().readTree(mapper.writeValueAsString(hashmap))
</code></pre>