Code example for JsonParser

Methods: parse

	private String makePretty(String uglyJSONString) {
		Gson gson = new GsonBuilder().setPrettyPrinting().create();
		JsonParser jp = new JsonParser();
		JsonElement je = jp.parse(uglyJSONString);
		String prettyJsonString = gson.toJson(je);
		return prettyJsonString;
	public static class CandidateList { 
		private int id;
		private String name;
		private int nVotes;
		private float percent;
		public CandidateList(int id,String name,int nVotes,float percent){;;
Connect your IDE to all the code out there  Get Codota for Java