code: public static CmsBasicFormField createField(
          CmsXmlContentProperty propertyConfig,
          String fieldId,
          I_CmsFormWidgetMultiFactory factory,
          Map<String, String> additionalParams,
          boolean alwaysAllowEmpty) {
  
          String widgetConfigStr = propertyConfig.getWidgetConfiguration();
          if (widgetConfigStr == null) {
              widgetConfigStr = "";
          }
  
          String label = propertyConfig.getNiceName();
          if (label == null) {
              label = propertyConfig.getName();
          }
  
          String description = propertyConfig.getDescription();
          if (CmsStringUtil.isEmpty(description)) {
              description = "";
          }
  
          Map<String, String> widgetConfig = CmsStringUtil.splitAsMap(widgetConfigStr, "|", ":");
          widgetConfig.putAll(additionalParams);
          String widgetType = propertyConfig.getWidget();
          I_CmsFormWidget widget = factory.createFormWidget(
              widgetType,
              widgetConfig,
              Optional.fromNullable(propertyConfig.getDefault()));
          CmsBasicFormField field = new CmsBasicFormField(
              fieldId,
              description,
              label,
              propertyConfig.getDefault(),
              widget);
          String ruleRegex = propertyConfig.getRuleRegex();
          if (!CmsStringUtil.isEmpty(ruleRegex)) {
              field.setValidator(new CmsRegexValidator(ruleRegex, propertyConfig.getError(), alwaysAllowEmpty));
          }
          return field;
      }
docs: Utility method for creating a single basic form field from an id and a property configuration.
  
  @param propertyConfig the configuration of the property
  @param fieldId the field id
  @param factory a factory for creating form  widgets
  @param additionalParams additional field parameters
  @param alwaysAllowEmpty indicates an empty value is allowed
  
  @return the newly created form field