APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.javadoc.internal.doclets.formats.html

public Class HtmlIds

extends Object
Class Inheritance
Imports
java.util.HashMap, .HashSet, .List, .Locale, .Map, .Set, java.util.stream.Collectors, .Stream, javax.lang.model.element.Element, .ElementKind, .ExecutableElement, .ModuleElement, .PackageElement, .TypeElement, .VariableElement, javax.lang.model.type.ArrayType, .DeclaredType, .TypeMirror, .TypeVariable, javax.lang.model.util.SimpleTypeVisitor9, jdk.javadoc.internal.doclets.toolkit.util.SummaryAPIListBuilder, .Utils, .VisibleMemberTable, jdk.javadoc.internal.html.HtmlId

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.

Field Summary

Modifier and TypeField and Description
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
private final HtmlConfiguration
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
private static final String
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
private final Map<ExecutableElement, List<HtmlId>>
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
private static final String
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
private static final String
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
private static final String
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
pack-priv static final HtmlId
private final Utils

Constructor Summary

AccessConstructor and Description
pack-priv
HtmlIds(HtmlConfiguration
the configuration
configuration
)

Creates a factory for element-specific ids.

Method Summary

Modifier and TypeMethod and Description
pack-priv HtmlId

Returns:

the id
forClass
(TypeElement
the class or interface
element
)

Returns an id for a class or interface.

private HtmlId

Returns:

the 1.4.x style anchor for the executable element
forErasure
(ExecutableElement
the element to anchor to
executableElement
)

Returns an id for the erasure of an executable element, or null if there are no type variables in the signature.

public HtmlId

Returns:

a unique id value for the heading
forHeading
(CharSequence
the text contained by the heading
headingText
,
Set<String>
the set of heading ids already generated for the current page
headingIds
)

Returns an id for a heading in a doc comment.

pack-priv static HtmlId

Returns:

the id
forIndexChar
(char
the character
character
)

Returns an id for a character on the A-Z Index page.

private HtmlId
forInherited(String prefix, TypeElement element)

pack-priv HtmlId

Returns:

the id
forInheritedClasses
(TypeElement
the class or interface
element
)

Returns an id for the list of classes and interfaces inherited from a class or interface.

pack-priv HtmlId

Returns:

the id
forInheritedFields
(TypeElement
the class or interface
element
)

Returns an id for the list of fields inherited from a class or interface.

pack-priv HtmlId

Returns:

the id
forInheritedMethods
(TypeElement
the class or interface
element
)

Returns an id for the list of methods inherited from a class or interface.

pack-priv HtmlId

Returns:

the id
forInheritedProperties
(TypeElement
the class or interface
element
)

Returns an id for the list of properties inherited from a class or interface.

pack-priv static HtmlId

Returns:

the id
forLine
(int
the line number
lineNumber
)

Returns an id for a line in a source-code listing.

pack-priv List<HtmlId>

Returns:

a non-empty list of ids to a constructor or a method
forMember
(ExecutableElement
a constructor or method
executable
)

Returns a non-empty list of ids to a constructor or a method.

pack-priv HtmlId

Returns:

the id
forMember
(VariableElement
the element
element
)

Returns an id for a field, suitable for use when the simple name will be unique within the page, such as in the page for the declaration of the enclosing class or interface.

pack-priv HtmlId

Returns:

the id
forMember
(TypeElement
the enclosing class or interface
typeElement
,
VariableElement
the element
member
)

Returns an id for a field, including the context of its documented enclosing class or interface.

private HtmlId
pack-priv static HtmlId

Returns:

the id
forMemberSummary
(VisibleMemberTable.Kind
the kind of member
kind
)

Returns an id for the member summary table of the given kind in a class page.

pack-priv HtmlId

Returns:

the id
forPackage
(PackageElement
the package
element
)

Returns an id for a package.

pack-priv HtmlId

Returns:

the id
forPackageName
(String
the package name
pkgName
)

Returns an id for a package name.

public HtmlId

Returns:

the id
forPage
(Navigation.PageMode
the kind of page
page
)

Returns an id for the entry on the HELP page for a kind of generated page.

public static HtmlId

Returns:

the id
forParam
(String
the parameter name
paramName
)

Returns an id for a parameter, such as a component of a record.

public HtmlId

Returns:

the id
forPreviewSection
(Element
the element
el
)

Returns an id for the "preview" section for an element.

pack-priv HtmlId

Returns:

the id
forProperty
(ExecutableElement
the element
element
)

Returns an id for a property, suitable for use when the simple name will be unique within the page, such as in the page for the declaration of the enclosing class or interface.

public HtmlId

Returns:

the id
forRestrictedSection
(ExecutableElement
the executable element
el
)

Returns an id for the "restricted" section for an executable element.

public HtmlId

Returns:

a unique id for the snippet
forSnippet
(Element
the element in whose documentation the snippet appears
e
,
Set<String>
the set of snippet ids already generated
snippetIds
)

Returns an id for a snippet.

pack-priv static HtmlId

Returns:

the id
forSummaryKind
(SummaryAPIListBuilder.SummaryElementKind
the kind of deprecated items in the section
kind
)

Returns an id for one of the kinds of section in the pages for item group summaries.

public static HtmlId

Returns:

the id
forTab
(HtmlId
the id for the table
tableId
,
int
the index of the tab
tabIndex
)

Returns an id for a "tab" in a table.

public static HtmlId

Returns:

the id
forTabPanel
(HtmlId
the id for the table
tableId
)

Returns an id for the "tab panel" in a table.

public static HtmlId

Returns:

the id
forText
(String
the text
text
,
Map<String, Integer>
the map of counts
counts
)

Returns an id for a fragment of text, such as in an @index tag, using a map of counts to ensure the id is unique.

public HtmlId

Returns:

the id
forTypeParam
(String
the name of the type parameter
paramName
,
Element
the enclosing element
owner
)

Returns an id for text documenting a type parameter of a class or method.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALL_CLASSES_TABLEback to summary
pack-priv static final HtmlId ALL_CLASSES_TABLE
ALL_MODULES_TABLEback to summary
pack-priv static final HtmlId ALL_MODULES_TABLE
ALL_PACKAGES_TABLEback to summary
pack-priv static final HtmlId ALL_PACKAGES_TABLE
ANNOTATION_TYPE_ELEMENT_DETAILback to summary
pack-priv static final HtmlId ANNOTATION_TYPE_ELEMENT_DETAIL
ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARYback to summary
pack-priv static final HtmlId ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY
ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARYback to summary
pack-priv static final HtmlId ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARY
CLASS_DESCRIPTIONback to summary
pack-priv static final HtmlId CLASS_DESCRIPTION
CLASS_SUMMARYback to summary
pack-priv static final HtmlId CLASS_SUMMARY
configurationback to summary
private final HtmlConfiguration configuration
CONSTRUCTOR_DETAILback to summary
pack-priv static final HtmlId CONSTRUCTOR_DETAIL
CONSTRUCTOR_SUMMARYback to summary
pack-priv static final HtmlId CONSTRUCTOR_SUMMARY
ENUM_CONSTANT_DETAILback to summary
pack-priv static final HtmlId ENUM_CONSTANT_DETAIL
ENUM_CONSTANT_SUMMARYback to summary
pack-priv static final HtmlId ENUM_CONSTANT_SUMMARY
EXTERNAL_SPECSback to summary
pack-priv static final HtmlId EXTERNAL_SPECS
FIELD_DETAILback to summary
pack-priv static final HtmlId FIELD_DETAIL
FIELD_SUMMARYback to summary
pack-priv static final HtmlId FIELD_SUMMARY
FIELDS_INHERITANCEback to summary
private static final String FIELDS_INHERITANCE
FOR_REMOVALback to summary
pack-priv static final HtmlId FOR_REMOVAL
HELP_KEYBOARD_NAVIGATIONback to summary
pack-priv static final HtmlId HELP_KEYBOARD_NAVIGATION
HELP_NAVIGATIONback to summary
pack-priv static final HtmlId HELP_NAVIGATION
HELP_PAGESback to summary
pack-priv static final HtmlId HELP_PAGES
HELP_RELEASESback to summary
pack-priv static final HtmlId HELP_RELEASES
idsback to summary
private final Map<ExecutableElement, List<HtmlId>> ids
METHOD_DETAILback to summary
pack-priv static final HtmlId METHOD_DETAIL
METHOD_SUMMARYback to summary
pack-priv static final HtmlId METHOD_SUMMARY
METHOD_SUMMARY_TABLEback to summary
pack-priv static final HtmlId METHOD_SUMMARY_TABLE
METHODS_INHERITANCEback to summary
private static final String METHODS_INHERITANCE
MODULE_DESCRIPTIONback to summary
pack-priv static final HtmlId MODULE_DESCRIPTION
MODULESback to summary
pack-priv static final HtmlId MODULES
NESTED_CLASS_SUMMARYback to summary
pack-priv static final HtmlId NESTED_CLASS_SUMMARY
NESTED_CLASSES_INHERITANCEback to summary
private static final String NESTED_CLASSES_INHERITANCE
PACKAGE_DESCRIPTIONback to summary
pack-priv static final HtmlId PACKAGE_DESCRIPTION
PACKAGE_SUMMARY_TABLEback to summary
pack-priv static final HtmlId PACKAGE_SUMMARY_TABLE
PACKAGESback to summary
pack-priv static final HtmlId PACKAGES
PROPERTIES_INHERITANCEback to summary
private static final String PROPERTIES_INHERITANCE
PROPERTY_DETAILback to summary
pack-priv static final HtmlId PROPERTY_DETAIL
PROPERTY_SUMMARYback to summary
pack-priv static final HtmlId PROPERTY_SUMMARY
SEARCH_INPUTback to summary
pack-priv static final HtmlId SEARCH_INPUT
SEARCH_INPUT_CONTAINERback to summary
pack-priv static final HtmlId SEARCH_INPUT_CONTAINER
SEARCH_MODULESback to summary
pack-priv static final HtmlId SEARCH_MODULES
SEARCH_RESULT_CONTAINERback to summary
pack-priv static final HtmlId SEARCH_RESULT_CONTAINER
SEARCH_RESULT_SECTIONback to summary
pack-priv static final HtmlId SEARCH_RESULT_SECTION
SERVICESback to summary
pack-priv static final HtmlId SERVICES
SKIP_NAVBAR_TOPback to summary
pack-priv static final HtmlId SKIP_NAVBAR_TOP
THEME_BUTTONback to summary
pack-priv static final HtmlId THEME_BUTTON
THEME_DARKback to summary
pack-priv static final HtmlId THEME_DARK
THEME_LIGHTback to summary
pack-priv static final HtmlId THEME_LIGHT
THEME_OSback to summary
pack-priv static final HtmlId THEME_OS
THEME_PANELback to summary
pack-priv static final HtmlId THEME_PANEL
TOC_ORDER_TOGGLEback to summary
pack-priv static final HtmlId TOC_ORDER_TOGGLE
TOP_OF_PAGEback to summary
pack-priv static final HtmlId TOP_OF_PAGE
UNNAMED_PACKAGE_ANCHORback to summary
pack-priv static final HtmlId UNNAMED_PACKAGE_ANCHOR
utilsback to summary
private final Utils utils

Constructor Detail

HtmlIdsback to summary
pack-priv HtmlIds(HtmlConfiguration configuration)

Creates a factory for element-specific ids.

Parameters
configuration:HtmlConfiguration

the configuration

Method Detail

forClassback to summary
pack-priv HtmlId forClass(TypeElement element)

Returns an id for a class or interface.

Parameters
element:TypeElement

the class or interface

Returns:HtmlId

the id

forErasureback to summary
private 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.

Parameters
executableElement:ExecutableElement

the element to anchor to

Returns:HtmlId

the 1.4.x style anchor for the executable element

forHeadingback to summary
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.

Parameters
headingText:CharSequence

the text contained by the heading

headingIds:Set<String>

the set of heading ids already generated for the current page

Returns:HtmlId

a unique id value for the heading

forIndexCharback to summary
pack-priv static HtmlId forIndexChar(char character)

Returns an id for a character on the A-Z Index page.

Parameters
character:char

the character

Returns:HtmlId

the id

forInheritedback to summary
private HtmlId forInherited(String prefix, TypeElement element)
forInheritedClassesback to summary
pack-priv HtmlId forInheritedClasses(TypeElement element)

Returns an id for the list of classes and interfaces inherited from a class or interface.

Note

the use of utils may not be strictly necessary.

Parameters
element:TypeElement

the class or interface

Returns:HtmlId

the id

forInheritedFieldsback to summary
pack-priv HtmlId forInheritedFields(TypeElement element)

Returns an id for the list of fields inherited from a class or interface.

Parameters
element:TypeElement

the class or interface

Returns:HtmlId

the id

forInheritedMethodsback to summary
pack-priv HtmlId forInheritedMethods(TypeElement element)

Returns an id for the list of methods inherited from a class or interface.

Parameters
element:TypeElement

the class or interface

Returns:HtmlId

the id

forInheritedPropertiesback to summary
pack-priv HtmlId forInheritedProperties(TypeElement element)

Returns an id for the list of properties inherited from a class or interface.

Parameters
element:TypeElement

the class or interface

Returns:HtmlId

the id

forLineback to summary
pack-priv static HtmlId forLine(int lineNumber)

Returns an id for a line in a source-code listing.

Parameters
lineNumber:int

the line number

Returns:HtmlId

the id

forMemberback to summary
pack-priv List<HtmlId> forMember(ExecutableElement executable)

Returns a non-empty list of ids to a constructor or a method. The ids from the returned list are alternative: the given constructor or method can be equally referred to by any of those ids.

Parameters
executable:ExecutableElement

a constructor or method

Returns:List<HtmlId>

a non-empty list of ids to a constructor or a method

forMemberback to summary
pack-priv HtmlId forMember(VariableElement element)

Returns an id for a field, suitable for use when the simple name will be unique within the page, such as in the page for the declaration of the enclosing class or interface.

Warning

the name may not be unique if a property with the same name is also being documented in the same class.

Parameters
element:VariableElement

the element

Returns:HtmlId

the id

See Also
forProperty(ExecutableElement)
forMemberback to summary
pack-priv HtmlId forMember(TypeElement typeElement, VariableElement member)

Returns an id for a field, including the context of its documented enclosing class or interface.

Parameters
typeElement:TypeElement

the enclosing class or interface

member:VariableElement

the element

Returns:HtmlId

the id

forMember0back to summary
private HtmlId forMember0(ExecutableElement element)
forMemberSummaryback to summary
pack-priv static HtmlId forMemberSummary(VisibleMemberTable.Kind kind)

Returns an id for the member summary table of the given kind in a class page.

Parameters
kind:VisibleMemberTable.Kind

the kind of member

Returns:HtmlId

the id

forPackageback to summary
pack-priv HtmlId forPackage(PackageElement element)

Returns an id for a package.

Parameters
element:PackageElement

the package

Returns:HtmlId

the id

forPackageNameback to summary
pack-priv HtmlId forPackageName(String pkgName)

Returns an id for a package name.

Parameters
pkgName:String

the package name

Returns:HtmlId

the id

forPageback to summary
public HtmlId forPage(Navigation.PageMode page)

Returns an id for the entry on the HELP page for a kind of generated page.

Parameters
page:Navigation.PageMode

the kind of page

Returns:HtmlId

the id

forParamback to summary
public static HtmlId forParam(String paramName)

Returns an id for a parameter, such as a component of a record.

Warning

this may not be unique on the page if used when there are other like-named parameters.

Parameters
paramName:String

the parameter name

Returns:HtmlId

the id

forPreviewSectionback to summary
public HtmlId forPreviewSection(Element el)

Returns an id for the "preview" section for an element.

Parameters
el:Element

the element

Returns:HtmlId

the id

forPropertyback to summary
pack-priv HtmlId forProperty(ExecutableElement element)

Returns an id for a property, suitable for use when the simple name will be unique within the page, such as in the page for the declaration of the enclosing class or interface.

Warning

the name may not be unique if a field with the same name is also being documented in the same class.

Parameters
element:ExecutableElement

the element

Returns:HtmlId

the id

See Also
forMember(VariableElement)
forRestrictedSectionback to summary
public HtmlId forRestrictedSection(ExecutableElement el)

Returns an id for the "restricted" section for an executable element.

Parameters
el:ExecutableElement

the executable element

Returns:HtmlId

the id

forSnippetback to summary
public HtmlId forSnippet(Element e, Set<String> snippetIds)

Returns an id for a snippet.

Parameters
e:Element

the element in whose documentation the snippet appears

snippetIds:Set<String>

the set of snippet ids already generated

Returns:HtmlId

a unique id for the snippet

forSummaryKindback to summary
pack-priv static HtmlId forSummaryKind(SummaryAPIListBuilder.SummaryElementKind kind)

Returns an id for one of the kinds of section in the pages for item group summaries.

Note

while the use of simple names (that are not keywords) may seem undesirable, they cannot conflict with the unqualified names of fields and properties, which should not also appear on the same page.

Parameters
kind:SummaryAPIListBuilder.SummaryElementKind

the kind of deprecated items in the section

Returns:HtmlId

the id

forTabback to summary
public static HtmlId forTab(HtmlId tableId, int tabIndex)

Returns an id for a "tab" in a table.

Parameters
tableId:HtmlId

the id for the table

tabIndex:int

the index of the tab

Returns:HtmlId

the id

forTabPanelback to summary
public static HtmlId forTabPanel(HtmlId tableId)

Returns an id for the "tab panel" in a table.

Parameters
tableId:HtmlId

the id for the table

Returns:HtmlId

the id

forTextback to summary
public static HtmlId forText(String text, Map<String, Integer> counts)

Returns an id for a fragment of text, such as in an @index tag, using a map of counts to ensure the id is unique.

Parameters
text:String

the text

counts:Map<String, Integer>

the map of counts

Returns:HtmlId

the id

forTypeParamback to summary
public HtmlId forTypeParam(String paramName, Element owner)

Returns an id for text documenting a type parameter of a class or method.

Parameters
paramName:String

the name of the type parameter

owner:Element

the enclosing element

Returns:HtmlId

the id