code: protected JSONObject elementToJson(CmsContainerElementBean element, Set<String> excludeSettings) {
  
          JSONObject data = null;
          try {
              data = new JSONObject();
              data.put(FavListProp.ELEMENT.name().toLowerCase(), element.getId().toString());
              if (element.getFormatterId() != null) {
                  data.put(FavListProp.FORMATTER.name().toLowerCase(), element.getFormatterId().toString());
              }
              JSONObject properties = new JSONObject();
              for (Map.Entry<String, String> entry : element.getIndividualSettings().entrySet()) {
                  String settingKey = entry.getKey();
                  if (!excludeSettings.contains(settingKey)) {
                      properties.put(entry.getKey(), entry.getValue());
                  }
              }
              data.put(FavListProp.PROPERTIES.name().toLowerCase(), properties);
          } catch (JSONException e) {
              // should never happen
              if (!LOG.isDebugEnabled()) {
                  LOG.warn(e.getLocalizedMessage());
              }
              LOG.debug(e.getLocalizedMessage(), e);
              return null;
          }
          return data;
      }
docs: Converts the given element to JSON.<p>
  
  @param element the element to convert
  @param excludeSettings the keys of settings which should not be written to the JSON
  
  @return the JSON representation