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

public Class IndexWriter

extends HtmlDocletWriter
Class Inheritance
Imports
java.util.List, .ListIterator, .SortedSet, java.util.stream.Stream, javax.lang.model.element.Element, .ElementKind, .ModuleElement, .PackageElement, .TypeElement, jdk.javadoc.internal.doclets.formats.html.Navigation.PageMode, jdk.javadoc.internal.doclets.formats.html.markup.BodyContents, .HtmlStyles, jdk.javadoc.internal.doclets.toolkit.DocletException, jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException, .DocPath, .DocPaths, .IndexBuilder, .IndexItem, jdk.javadoc.internal.html.Content, .ContentBuilder, .Entity, .HtmlTag, .HtmlTree, .Text

Generator for either a single index or split index for all documented elements, terms defined in some documentation comments, and summary pages.
See Also
IndexBuilder

Field Summary

Modifier and TypeField and Description
protected final List<Character>
protected final List<Character>
protected final IndexBuilder
protected final boolean
Inherited from jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter:
comparatorsconfigurationcontentsdocPathshtmlIdsindexAnchorTablelinksmainBodyScriptmessagesoptionspathpathToRootresourcestableOfContentsutilswinTitle

Constructor Summary

AccessConstructor and Description
protected
IndexWriter(HtmlConfiguration
the current configuration
configuration
,
DocPath
the file to be generated
path
,
List<Character>
the initial characters of all index items
allFirstCharacters
,
List<Character>
the initial characters of the index items to appear on this page
displayFirstCharacters
)

Creates a writer that can write a page containing some or all of the overall index.

Method Summary

Modifier and TypeMethod and Description
protected void
addClassInfo(TypeElement
the element
te
,
Content
the content to which the class info will be added
content
)

Adds information for the given type element.

protected void
addComment(Element
the element
element
,
Content
the content to which the comment will be added
content
)

Adds a comment for an element in the index.

protected void
addContents(char
the first character of the names of the items
ch
,
SortedSet<IndexItem>
the items
items
,
Content
the content to which to add the items
content
)

Adds a set of items to the page.

protected void
addDescription(IndexItem
the item
indexItem
,
Content
the list
dl
)

Adds the description for an index item into a list.

protected void
addElementDescription(IndexItem
the item to be documented
item
,
Content
the content to which the description will be added
target
)

Add one line summary comment for the item.

protected void
addHeading(char
the first character of the names of the items
ch
,
Content
the content to which to add the items
content
)

Adds a heading containing the first character for a set of items.

protected void
addLinksForIndexes(List<Character>
the list of all first characters to be linked
allFirstCharacters
,
Content
the content to which the links for indexes will be added
content
)

Add links for all the index files, based on the first character of the names of the items.

protected void
addMemberDesc(Element
the element
member
,
TypeElement
the enclosing type element
enclosing
,
Content
the content to which the member description will be added
content
)

Adds a description for a member element.

protected void
addTagDescription(IndexItem
the item
item
,
Content
the list to which to add the description
target
)

Adds a description for an item found in a documentation comment.

public void
buildPage()

Implements abstract jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter.buildPage.

Generates a page containing some or all of the overall index.

public static void
generate(HtmlConfiguration
the configuration
configuration
)

Generates the main index of all documented elements, terms defined in some documentation comments, and summary pages.

private Content
Inherited from jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter:
addInlineCommentaddInlineCommentaddInlineDeprecatedCommentaddPreQualifiedClassLinkaddPreQualifiedClassLinkaddPreQualifiedStrongClassLinkaddPreviewCommentaddPreviewInfoaddPreviewSummaryaddRestrictedInfoaddRestrictedSummaryaddSrcLinkaddSummaryCommentaddSummaryCommentaddSummaryDeprecatedCommentaddTagsInfocommentTagsToContentcommentTagsToContentcommentTagsToContentcreateTableOfContentsgetAnnotationInfogetAnnotationInfogetAnnotationsgetBlockTagOutputgetBlockTagOutputgetBodygetBodyStylegetCrossClassLinkgetCrossModuleLinkgetCrossPackageLinkgetCurrentTypeElementgetDeprecatedPhrasegetDescriptiongetDocLinkgetDocLinkgetDocLinkgetDocLinkgetDocLinkgetEnclosingPackageNamegetFileTitlegetFootergetGeneratorgetHeadergetHeadergetLinkgetLocalizedPackageNamegetLocalStylesheetsgetModuleLinkgetModuleLinkgetNavBargetNavLinkToOverviewTreegetPackageLabelgetPackageLinkgetPackageLinkgetPackageTableHeadergetPreQualifiedClassLinkgetQualifiedClassLinkgetTagletWriterInstancegetTagletWriterInstancegetTypeParameterLinksgetWindowTitlehasSerializationOverviewTagsignoreNonInlineTaginvalidTagOutputisIndexablepathStringpathStringprintHtmlDocumentprintHtmlDocumentprintHtmlDocumentreplaceDocRootDirresolveExternalSpecURIwriteGenerating

Field Detail

allFirstCharactersback to summary
protected final List<Character> allFirstCharacters
displayFirstCharactersback to summary
protected final List<Character> displayFirstCharacters
mainIndexback to summary
protected final IndexBuilder mainIndex
splitIndexback to summary
protected final boolean splitIndex

Constructor Detail

IndexWriterback to summary
protected IndexWriter(HtmlConfiguration configuration, DocPath path, List<Character> allFirstCharacters, List<Character> displayFirstCharacters)

Creates a writer that can write a page containing some or all of the overall index.

Parameters
configuration:HtmlConfiguration

the current configuration

path:DocPath

the file to be generated

allFirstCharacters:List<Character>

the initial characters of all index items

displayFirstCharacters:List<Character>

the initial characters of the index items to appear on this page

Method Detail

addClassInfoback to summary
protected void addClassInfo(TypeElement te, Content content)

Adds information for the given type element.

Parameters
te:TypeElement

the element

content:Content

the content to which the class info will be added

addCommentback to summary
protected void addComment(Element element, Content content)

Adds a comment for an element in the index. If the element is deprecated and it has a @deprecated tag, use that comment; otherwise, if the containing class for this element is deprecated, then add the word "Deprecated." at the start and then print the normal comment.

Parameters
element:Element

the element

content:Content

the content to which the comment will be added

addContentsback to summary
protected void addContents(char ch, SortedSet<IndexItem> items, Content content)

Adds a set of items to the page.

Parameters
ch:char

the first character of the names of the items

items:SortedSet<IndexItem>

the items

content:Content

the content to which to add the items

addDescriptionback to summary
protected void addDescription(IndexItem indexItem, Content dl)

Adds the description for an index item into a list.

Parameters
indexItem:IndexItem

the item

dl:Content

the list

addElementDescriptionback to summary
protected void addElementDescription(IndexItem item, Content target)

Add one line summary comment for the item.

Parameters
item:IndexItem

the item to be documented

target:Content

the content to which the description will be added

addHeadingback to summary
protected void addHeading(char ch, Content content)

Adds a heading containing the first character for a set of items.

Parameters
ch:char

the first character of the names of the items

content:Content

the content to which to add the items

addLinksForIndexesback to summary
protected void addLinksForIndexes(List<Character> allFirstCharacters, Content content)

Add links for all the index files, based on the first character of the names of the items.

Parameters
allFirstCharacters:List<Character>

the list of all first characters to be linked

content:Content

the content to which the links for indexes will be added

addMemberDescback to summary
protected void addMemberDesc(Element member, TypeElement enclosing, Content content)

Adds a description for a member element.

Parameters
member:Element

the element

enclosing:TypeElement

the enclosing type element

content:Content

the content to which the member description will be added

addTagDescriptionback to summary
protected void addTagDescription(IndexItem item, Content target)

Adds a description for an item found in a documentation comment.

Parameters
item:IndexItem

the item

target:Content

the list to which to add the description

buildPageback to summary
public void buildPage() throws DocFileIOException

Implements abstract jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter.buildPage.

Generates a page containing some or all of the overall index.

Annotations
@Override
Exceptions
DocFileIOException:
if an error occurs while writing the page
generateback to summary
public static void generate(HtmlConfiguration configuration) throws DocletException

Generates the main index of all documented elements, terms defined in some documentation comments, and summary pages. If HtmlOptions#splitIndex() is true, a separate page is generated for each initial letter; otherwise, a single page is generated for all items in the index.

Parameters
configuration:HtmlConfiguration

the configuration

Exceptions
DocletException:
if an error occurs while writing the files
getVerticalSeparatorback to summary
private Content getVerticalSeparator()