eXtreme Development

Java - parsing JSON

//_typeGroup => topics //Object document = Configuration.defaultConfiguration().jsonProvider().parse(content.toString());

//System.out.println("DOC ID: " + JsonPath.read(document, "$.doc.info.id")); //System.out.println("TYPE GROUP ALL: " + JsonPath.read(document, "$.*._typeGroup")); //System.out.println("TYPE GROUP TOP: " + JsonPath.read(document, "$.[?(@._typeGroup)]")); //System.out.println("TYPE GROUP TOP: " + JsonPath.read(document, "$[2]._typeGroup"));

//"$.*._typeGroup" //$.._typeGroup[?(@.topics)] //$..book[?(@.isbn)] //String author1 = JsonPath.read(document, "$.store.book[1].author");


//System.out.println("1: " + jsonObj.getJSONObject(parentKey).get("_typeGroup")); //System.out.println("3: " + jsonObj.getJSONObject(parentKey).get("name")); //.getJSONObject("_typeGroup").toString()); //System.out.println("3: " + jsonObj.getJSONObject(parentKey).getJSONObject("name")); //System.out.println("parent key: " + parentKey); System.out.println("0: child key: " + childKey);




SourceForge BootStrap