code: public Button deserialize(JsonElement json, Type typeOfT,
  			JsonDeserializationContext context) throws JsonParseException {
  		String buttonTypeString = json.getAsJsonObject().get("type")
  				.getAsString();
  		ButtonType buttonType = ButtonType.valueOf(buttonTypeString
  				.toUpperCase());
  		Class<?> buttonClass = getButtonClass(buttonType);
  		return context.deserialize(json, buttonClass);
  	}
docs: /*
  (non-Javadoc)
  
  @see
  com.google.gson.JsonDeserializer#deserialize(com.google.gson.JsonElement,
  java.lang.reflect.Type, com.google.gson.JsonDeserializationContext)