docs: protected void initField(Element elem, CmsXmlContentDefinition contentDef) throws CmsXmlException {
  
          String nameVal = elem.elementText(CmsConfigurationReader.N_PROPERTY_NAME);
          if (nameVal == null) {
              throw new CmsXmlException(Messages.get().container(Messages.ERR_XMLCONTENT_BAD_FIELD_NAME_1, nameVal));
          }
          final String name = nameVal.trim();
  
          String ruleRegex = elem.elementText(CmsConfigurationReader.N_RULE_REGEX);
          String ruleType = elem.elementText(CmsConfigurationReader.N_RULE_TYPE);
          String error = elem.elementText(CmsConfigurationReader.N_ERROR);
          if (error == null) {
              error = "";
          }
          if (!CmsStringUtil.isEmptyOrWhitespaceOnly(ruleRegex)) {
              addValidationRule(contentDef, name, ruleRegex, error, "warning".equalsIgnoreCase(ruleType));
          }
  
          String defaultValue = elem.elementText(CmsConfigurationReader.N_DEFAULT);
          String defaultResolveMacros = elem.elementTextTrim(FieldSettingElems.DefaultResolveMacros.name());
          if (!CmsStringUtil.isEmptyOrWhitespaceOnly(defaultValue)) {
              addDefault(contentDef, name, defaultValue, defaultResolveMacros);
          }
  
          String widget = elem.elementText(CmsConfigurationReader.N_WIDGET);
          String widgetConfig = elem.elementText(CmsConfigurationReader.N_WIDGET_CONFIG);
          if (widget != null) {
              addWidget(contentDef, name, widget);
          }
          if (widgetConfig != null) {
              widgetConfig = widgetConfig.trim();
              addConfiguration(contentDef, name, widgetConfig);
          }
  
          String niceName = elem.elementText(CmsConfigurationReader.N_DISPLAY_NAME);
          if (niceName != null) {
              m_fieldNiceNames.put(name, niceName);
          }
          String description = elem.elementText(CmsConfigurationReader.N_DESCRIPTION);
          if (description != null) {
              m_fieldDescriptions.put(name, description);
          }
          for (Element mappingElem : elem.elements(FieldSettingElems.Mapping.name())) {
              String mapTo = mappingElem.elementText(FieldSettingElems.MapTo.name());
              String useDefault = mappingElem.elementText(FieldSettingElems.UseDefault.name());
              if (mapTo != null) {
                  addMapping(contentDef, name, mapTo, useDefault);
              }
          }
          String display = elem.elementTextTrim(FieldSettingElems.Display.name());
          if (!CmsStringUtil.isEmptyOrWhitespaceOnly(display)) {
              try {
                  addDisplayType(contentDef, name, DisplayType.valueOf(display));
              } catch (Exception e) {
                  LOG.error(e.getLocalizedMessage(), e);
              }
          }
          String synchronization = elem.elementTextTrim(FieldSettingElems.Synchronization.name());
          if (Boolean.parseBoolean(synchronization)) {
              m_synchronizations.add(name);
          }
          for (Element relElem : elem.elements(FieldSettingElems.Relation.name())) {
              String type = relElem.elementTextTrim(FieldSettingElems.Type.name());
              String invalidate = relElem.elementTextTrim(FieldSettingElems.Invalidate.name());
              if (type != null) {
                  type = type.toLowerCase();
              }
              if (invalidate != null) {
                  invalidate = invalidate.toLowerCase();
              }
              addCheckRule(contentDef, name, invalidate, type);
          }
  
          for (Element visElem : elem.elements(FieldSettingElems.Visibility.name())) {
              String params = visElem.getText();
              VisibilityConfiguration visConfig = createVisibilityConfiguration(null, params);
              m_visibilityConfigurations.put(name, visConfig);
          }
  
          for (Element visElem : elem.elements(FieldSettingElems.FieldVisibility.name())) {
              String className = visElem.elementTextTrim(FieldSettingElems.Class.name());
              String params = visElem.elementTextTrim(FieldSettingElems.Params.name());
              VisibilityConfiguration visConfig = createVisibilityConfiguration(className, params);
              m_visibilityConfigurations.put(name, visConfig);
          }
  
          String nestedFormatter = elem.elementTextTrim(FieldSettingElems.NestedFormatter.name());
          if (Boolean.parseBoolean(nestedFormatter)) {
              m_nestedFormatterElements.add(name);
          }
  
          String search = elem.elementTextTrim(FieldSettingElems.Search.name());
          if (search != null) {
              addSimpleSearchSetting(contentDef, name, search);
          }
      }