title: Pretty printing JSON from Jackson 2.2's ObjectMapper
body: <p>Right now I have an instance of <code>org.fasterxml.jackson.databind.ObjectMapper</code> and would like to get a <code>String</code> with pretty JSON. All of the results of my Google searches have come up with Jackson 1.x ways of doing this and I can't seem to find the proper, non-deprecated way of doing this with 2.2. Even though I don't believe that code is absolutely necessary for this question, here's what I have right now:</p>
  
  <pre><code>ObjectMapper mapper = new ObjectMapper();
  mapper.setSerializationInclusion(Include.NON_NULL);
  System.out.println("\n\n----------REQUEST-----------");
  StringWriter sw = new StringWriter();
  mapper.writeValue(sw, jsonObject);
  // Want pretty version of sw.toString() here
  </code></pre>