code: public JsonElement serialize(Button src, Type typeOfSrc,
  			JsonSerializationContext context) {
  		ButtonType buttonType = src.getType();
  		Class<?> buttonClass = getButtonClass(buttonType);
  		return context.serialize(src, buttonClass);
  	}
docs: /*
  (non-Javadoc)
  
  @see com.google.gson.JsonSerializer#serialize(java.lang.Object,
  java.lang.reflect.Type, com.google.gson.JsonSerializationContext)