Example usage for com.fasterxml.jackson.core JsonParser JsonParser

List of usage examples for com.fasterxml.jackson.core JsonParser JsonParser

Introduction

In this page you can find the example usage for com.fasterxml.jackson.core JsonParser JsonParser.

Prototype

protected JsonParser() 

Source Link

Usage

From source file:com.mycompany.mailchimpwiremock.HttpFetcherTest.java

/**
 *
 * @param jsonString//  w  ww.j  ava 2 s .  c om
 * @return
 */
public static String toGsonFormat(String jsonString) {
    JsonParser parser = new JsonParser();
    JsonObject json = parser.parse(jsonString).getAsJsonObject();

    Gson gson = new GsonBuilder().setPrettyPrinting().create();
    String formatJson = gson.toJson(json);

    return formatJson; //gson
}