docs: protected void addWidget(CmsXmlContentDefinition contentDefinition, String elementName, String widgetClassOrAlias)
      throws CmsXmlException {
  
          if (!elementName.contains("/") && (contentDefinition.getSchemaType(elementName) == null)) {
              throw new CmsXmlException(
                  Messages.get().container(Messages.ERR_XMLCONTENT_INVALID_ELEM_LAYOUTWIDGET_1, elementName));
          }
  
          // get the base widget from the XML content type manager
          I_CmsWidget widget = OpenCms.getXmlContentTypeManager().getWidget(widgetClassOrAlias);
  
          if (widget == null) {
              // no registered widget class found
              if (CmsStringUtil.isValidJavaClassName(widgetClassOrAlias)) {
                  // java class name given, try to create new instance of the class and cast to widget
                  try {
                      Class<?> specialWidgetClass = Class.forName(widgetClassOrAlias);
                      if (I_CmsComplexWidget.class.isAssignableFrom(specialWidgetClass)) {
                          m_complexWidgets.put(elementName, (I_CmsComplexWidget)(specialWidgetClass.newInstance()));
                          return;
                      } else {
                          widget = (I_CmsWidget)specialWidgetClass.newInstance();
                      }
                  } catch (Exception e) {
                      throw new CmsXmlException(
                          Messages.get().container(
                              Messages.ERR_XMLCONTENT_INVALID_CUSTOM_CLASS_3,
                              widgetClassOrAlias,
                              elementName,
                              contentDefinition.getSchemaLocation()),
                          e);
                  }
              }
              if (widget == null) {
                  // no valid widget found
                  throw new CmsXmlException(
                      Messages.get().container(
                          Messages.ERR_XMLCONTENT_INVALID_WIDGET_3,
                          widgetClassOrAlias,
                          elementName,
                          contentDefinition.getSchemaLocation()));
              }
          }
          m_elementWidgets.put(elementName, widget);
      }