java.lang.Object
org.jdrupes.mdoclet.internal.doclets.formats.html.HtmlIds

public class HtmlIds extends Object
Centralized constants and factory methods for HTML ids.

To ensure consistency, these constants and methods should be used both when declaring ids (for example, HtmlTree.setId) and creating references (for example, Links.createLink).

Most ids are mostly for internal use within the pages of a documentation bundle. However, the ids for member declarations may be referred to from other documentation using {@link}, and should not be changed without due consideration for the compatibility impact.

The use of punctuating characters is inconsistent and could be improved.

Constants and methods are static where possible. However, some methods require access to utils and are better provided as instance methods.

  • Methodendetails

    • forErasure

      protected HtmlId forErasure(ExecutableElement executableElement)
      Returns an id for the erasure of an executable element, or null if there are no type variables in the signature.

      For backward compatibility, include an anchor using the erasures of the parameters. NOTE: We won’t need this method anymore after we fix @see tags so that they use the type instead of the erasure.

      Parameter:
      executableElement - the element to anchor to
      Gibt zurück:
      the 1.4.x style anchor for the executable element
    • forTab

      public static HtmlId forTab(HtmlId tableId, int tabIndex)
      Returns an id for a “tab” in a table.
      Parameter:
      tableId - the id for the table
      tabIndex - the index of the tab
      Gibt zurück:
      the id
    • forTabPanel

      public static HtmlId forTabPanel(HtmlId tableId)
      Returns an id for the “tab panel” in a table.
      Parameter:
      tableId - the id for the table
      Gibt zurück:
      the id
    • forPreviewSection

      Returns an id for the “preview” section for an element.
      Parameter:
      el - the element
      Gibt zurück:
      the id
    • forPage

      Returns an id for the entry on the HELP page for a kind of generated page.
      Parameter:
      page - the kind of page
      Gibt zurück:
      the id
    • forHeading

      public HtmlId forHeading(CharSequence headingText, Set<String> headingIds)
      Returns an id for a heading in a doc comment.

      The id value is derived from the contents of the heading with additional checks to make it unique within its containing page.

      Parameter:
      headingText - the text contained by the heading
      headingIds - the set of heading ids already generated for the current page
      Gibt zurück:
      a unique id value for the heading