title: Custom pretty printer using Jackson library
body: <p>I have data in a Map object and I want to print it in a json format. I tried using DefaultPrettyPrinter </p>
  
  <pre><code>mapper.writerWithDefaultPrettyPrinter().writeValue(filePath, mapObject);
  </code></pre>
  
  <p>but the format is not what I expected. I am getting output like this:</p>
  
  <pre><code>{
    "arrVals" : ["value-1","value-2"]
  }
  </code></pre>
  
  <p>I want output like this:</p>
  
  <pre><code>{
    "arrVals" : [
      "value-1",
      "value-2"
    ]
  }
  </code></pre>