Code example for JsonParser

Methods: parse

0
 
public class DataExtractor { 
	private DataExtractor(){} // Locked 
	public static JsonObject getJsonObjectFromEntity(HttpEntity httpEntity) {
 
		JsonParser parsing = new JsonParser();
		JsonElement output = null;
		JsonObject outj = null;
		 
		try { 
			output = parsing.parse(new InputStreamReader(httpEntity.getContent()));
			outj = output.getAsJsonObject();
			//outj.remove("lyre"); 
 
		} catch (JsonSyntaxException e) {
 
			e.printStackTrace();
		} catch (JsonIOException e) {
 
			e.printStackTrace();