1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| import com.google.gson.Gson import com.google.gson.JsonParser import scala.collection.mutable.ArrayBuffer
val jsonparam = """{"RERUNNING":{"nodeName":"test_zhangjiaqi_1","preNodes":[],"prevInterpreters":[],"rerun":"false"},"name":"123123123sdfasdf","path":[{"name":"hdfs:
val gson = new Gson() val parser = new JsonParser(); val p = parser.parse(jsonparam).getAsJsonObject()
val name = p.get("name") println(name)
val jsonArray = p.getAsJsonArray("path") val je = jsonArray.get(0).getAsJsonObject println(je.get("name"))
|