code: public void addCustomTag(String classname, JavaFileManager fileManager, String tagletPath) {
          try {
              ClassLoader tagClassLoader;
              if (!fileManager.hasLocation(TAGLET_PATH)) {
                  List<File> paths = new ArrayList<>();
                  if (tagletPath != null) {
                      for (String pathname : tagletPath.split(File.pathSeparator)) {
                          paths.add(new File(pathname));
                      }
                  }
                  if (fileManager instanceof StandardJavaFileManager) {
                      ((StandardJavaFileManager) fileManager).setLocation(TAGLET_PATH, paths);
                  }
              }
              tagClassLoader = fileManager.getClassLoader(TAGLET_PATH);
              Class<? extends jdk.javadoc.doclet.Taglet> customTagClass =
                      tagClassLoader.loadClass(classname).asSubclass(jdk.javadoc.doclet.Taglet.class);
              jdk.javadoc.doclet.Taglet instance = customTagClass.getConstructor().newInstance();
              instance.init(docEnv, doclet);
              Taglet newLegacy = new UserTaglet(instance);
              String tname = newLegacy.getName();
              Taglet t = customTags.get(tname);
              if (t != null) {
                  customTags.remove(tname);
              }
              customTags.put(tname, newLegacy);
              messages.notice("doclet.Notice_taglet_registered", classname);
          } catch (Exception exc) {
              messages.error("doclet.Error_taglet_not_registered", exc.getClass().getName(), classname);
          }
      }
docs: Add a new <code>Taglet</code>.  Print a message to indicate whether or not
  the Taglet was registered properly.
  @param classname  the name of the class representing the custom tag.
  @param fileManager the filemanager to load classes and resources.
  @param tagletPath  the path to the class representing the custom tag.