Java Json Get getPrettyJsonWriterFactory()

Here you can find the source of getPrettyJsonWriterFactory()

Description

get Pretty Json Writer Factory

License

Open Source License

Declaration

private static JsonWriterFactory getPrettyJsonWriterFactory() 

Method Source Code

//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;
    }
}

Related

  1. getJsonNumberOrNull(JsonObject object, String key)
  2. getJsonObject(JsonObject object, String name)
  3. getJsonValue(String json_path, JsonObject response)
  4. getKeyAsString(JsonObject obj, String key, String defaultValue)
  5. getLongProperty(JsonObject object, String property)
  6. getSitesFromDb(String replicationSitesInDB)
  7. getString(JsonObject jso, String name)
  8. getValueFromJson(JsonObject currentJsonObject, String key)