Here you can find the source of getPrettyJsonWriterFactory()
private static JsonWriterFactory getPrettyJsonWriterFactory()
//package com.java2s; //License from project: Open Source License import java.util.HashMap; import java.util.Map; import javax.json.Json; import javax.json.JsonWriterFactory; import javax.json.stream.JsonGenerator; public class Main { private static JsonWriterFactory FACTORY_INSTANCE; private static JsonWriterFactory getPrettyJsonWriterFactory() { if (null == FACTORY_INSTANCE) { final Map<String, Object> properties = new HashMap<>(1); properties.put(JsonGenerator.PRETTY_PRINTING, true); FACTORY_INSTANCE = Json.createWriterFactory(properties); }// w ww . j a v a2 s . com return FACTORY_INSTANCE; } }