Code example for JsonParser

Methods: parse

0
		return getGson(clazz).fromJson(json, clazz);
	} 
 
	@SuppressWarnings("unchecked") 
	public <T> T fromJson(String json) {
		JsonElement element = parser.parse(json);
		return (T)parseElement(element);
		 
	} 
	 
	@SuppressWarnings("unchecked") 
	private <T> T parseElement(JsonElement element){
		if(element.isJsonPrimitive())
			return (T)parse(element.getAsJsonPrimitive());
		if(element.isJsonArray())
			return (T)parse(element.getAsJsonArray());
		return (T)parse(element.getAsJsonObject());
	} 
	 
	@SuppressWarnings("unchecked") 
Connect your IDE to all the code out there  Get Codota for Java