Here you can find the source of parse(String jsonLine)
Parameter | Description |
---|---|
jsonLine | a parameter |
public static Map parse(String jsonLine)
//package com.java2s; //License from project: Open Source License import java.util.Map; public class Main { /**//from w w w . ja v a2s .c o m * * @param jsonLine * @return parsed json string */ public static Map parse(String jsonLine) { Map jsonJavaRootObject = new Gson().fromJson(jsonLine, Map.class); return jsonJavaRootObject; /* JsonElement jelement = new JsonParser().parse(jsonLine); JsonObject jobject = jelement.getAsJsonObject(); jobject = jobject.getAsJsonObject("data"); JsonArray jarray = jobject.getAsJsonArray("translations"); jobject = jarray.get(0).getAsJsonObject(); String result = jobject.get("translatedText").toString(); return result; */ } }