docs: public CmsFormatterConfiguration getFormatters(CmsObject cms, CmsResource res) {
  
          if (CmsResourceTypeFunctionConfig.isFunction(res)) {
  
              CmsFormatterConfigurationCacheState formatters = getCachedFormatters();
              I_CmsFormatterBean function = formatters.getFormatters().get(res.getStructureId());
              if (function != null) {
                  return CmsFormatterConfiguration.create(cms, Collections.singletonList(function));
              } else {
                  if ((!res.getStructureId().isNullUUID())
                      && cms.existsResource(res.getStructureId(), CmsResourceFilter.IGNORE_EXPIRATION)) {
                      // usually if it's just been created, but not added to the configuration cache yet
                      CmsFormatterBeanParser parser = new CmsFormatterBeanParser(cms, new HashMap<>());
                      try {
                          function = parser.parse(
                              CmsXmlContentFactory.unmarshal(cms, cms.readFile(res)),
                              res.getRootPath(),
                              "" + res.getStructureId());
                          return CmsFormatterConfiguration.create(cms, Collections.singletonList(function));
                      } catch (Exception e) {
                          LOG.warn(e.getLocalizedMessage(), e);
                          return CmsFormatterConfiguration.EMPTY_CONFIGURATION;
                      }
  
                  } else {
                      // if a new function has been dragged on the page, it doesn't exist in the VFS yet, so we need a different
                      // instance as a replacement
                      CmsResource defaultFormatter = CmsFunctionRenderer.getDefaultFunctionInstance(cms);
                      if (defaultFormatter != null) {
                          I_CmsFormatterBean defaultFormatterBean = formatters.getFormatters().get(
                              defaultFormatter.getStructureId());
                          return CmsFormatterConfiguration.create(cms, Collections.singletonList(defaultFormatterBean));
                      } else {
                          LOG.warn("Could not read default formatter for functions.");
                          return CmsFormatterConfiguration.EMPTY_CONFIGURATION;
                      }
                  }
              }
          } else {
              try {
                  int resTypeId = res.getTypeId();
                  return getFormatters(
                      cms,
                      OpenCms.getResourceManager().getResourceType(resTypeId),
                      getFormattersFromSchema(cms, res));
              } catch (CmsLoaderException e) {
                  LOG.warn(e.getLocalizedMessage(), e);
                  return CmsFormatterConfiguration.EMPTY_CONFIGURATION;
              }
          }
      }