Here you can find the source of writeValueAsIndentString(Object value)
public static String writeValueAsIndentString(Object value) throws JsonProcessingException
//package com.java2s; /******************************************************************************* * Copyright ? 2012-2015 eBay Software Foundation * This program is dual licensed under the MIT and Apache 2.0 licenses. * Please see LICENSE for more information. *******************************************************************************/ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class Main { private static final ObjectMapper mapper = new ObjectMapper(); private static final ObjectMapper indentMapper = new ObjectMapper(); public static String writeValueAsIndentString(Object value) throws JsonProcessingException { return indentMapper.writeValueAsString(value); }//from w ww . j a v a2 s . c om public static String writeValueAsString(Object value) throws JsonProcessingException { return mapper.writeValueAsString(value); } }