Make relative path to documentation root URL available to Taglets

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P4
    • 27
    • Affects Version/s: 9
    • Component/s: tools
    • None

      The jdk.javadoc.doclet.Taglet interface lacks a way to retrieve the relative path to the documentation root URL. This means that taglets have to compute the relative path themselves based on the Element, which is a repetitive and error-prone task. What's worse is that Taglets are sometimes used outside the context of their containing Element, for example when citing the first sentence of a description in a top-level summary page. There is currently no way a Taglet can adjust its output to this kind of usage.

      There should be an easy way for a Taglet to retrieve the relative path to the documentation root URL. The simplest solution would be to evolve the toString(List, Element) method by adding a new default toString(List, Element, String) method that accepts the documentation root path as third argument, with the default implementation invoking the old method.

      Another solution would be to provide a new method in DocletEnvironment to retrieve either the relative path to the current page or the relative path from the current page to the root URL. We could also provide a higher level method to get the relative path to any documented Element.

            Assignee:
            Hannes Wallnoefer
            Reporter:
            Hannes Wallnoefer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: