Code example for JsonParseException

0
	 
	private class IterationDeserializer implements JsonDeserializer<Iteration> {
		public Iteration deserialize(JsonElement element, Type type, JsonDeserializationContext context) throws JsonParseException {
			JsonObject json = element.getAsJsonObject();
			if (!json.has("id")) { // TODO: || !json.has("start_date") || !json.has("end_date")) {
				throw new JsonParseException("Not a valid Iteration element");
			} 
			return new Iteration(json.get("id").getAsInt(), 0, 0);  // TODO: fix dates
		} 
	} 
	 
	private class TeamMemberDeserializer implements JsonDeserializer<TeamMember> {
		 
		public TeamMember deserialize(JsonElement element, Type type, JsonDeserializationContext context) throws JsonParseException {
			JsonObject json = element.getAsJsonObject();
			if (!json.has("id") || !json.has("email") || !json.has("name")) {
				throw new JsonParseException("Not a valid TeamMember element");
			} 
			int id = json.get("id").getAsInt();
			String name = json.get("name").getAsString();