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

public Class ModuleWriter

extends HtmlDocletWriter
Class Inheritance
Imports
java.util.ArrayList, .List, .Map, .Set, .SortedSet, .TreeMap, .TreeSet, javax.lang.model.element.Element, .ModuleElement, .PackageElement, .TypeElement, javax.lang.model.util.ElementFilter, com.sun.source.doctree.DeprecatedTree, .DocTree, java.util.function.Predicate, jdk.javadoc.doclet.DocletEnvironment.ModuleMode, 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.CommentHelper, .DocFileIOException, jdk.javadoc.internal.html.Content, .ContentBuilder, .Entity, .HtmlId, .HtmlStyle, .HtmlTree, .RawHtml, .Text

Class to generate file for each module contents in the right-hand frame. This will list all the required modules, packages and service types for the module. A click on any of the links will update the frame with the clicked element page.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
ModuleWriter.PackageEntry

Details about a package in a module.

Field Summary

Modifier and TypeField and Description
private final BodyContents
private final Map<ModuleElement, Content>
indirectModules

Map of indirect modules and modifiers, transitive closure, required by this module.

private final Map<ModuleElement, SortedSet<PackageElement>>
indirectOpenPackages

Map of indirect modules (transitive closure) and their open packages.

private final Map<ModuleElement, SortedSet<PackageElement>>
indirectPackages

Map of indirect modules (transitive closure) and their exported packages.

protected ModuleElement
mdle

The module being documented.

private final DocletEnvironment.ModuleMode
moduleMode

The module mode for this javadoc run.

private final Map<PackageElement, ModuleWriter.PackageEntry>
packages

Map of packages of this module, and details of whether they are exported or opened.

private final Map<TypeElement, SortedSet<TypeElement>>
provides

Map of services provided by this module, and set of its implementations.

private final Map<TypeElement, Content>
providesTrees

Map of services provided by the module and specified using @provides javadoc tag, and description.

private final Map<ModuleElement, Content>
requires

Map of module elements and modifiers required by this module.

private final SortedSet<TypeElement>
uses

Set of services used by the module.

private final Map<TypeElement, Content>
usesTrees

Map of services used by the module and specified using @uses javadoc tag, and description.

Inherited from jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter:
comparatorsconfigurationcontentsdocPathshtmlIdsindexAnchorTablelinksmainBodyScriptmessagesoptionspathpathToRootresourcestableOfContentsutilswinTitle

Constructor Summary

AccessConstructor and Description
public
ModuleWriter(HtmlConfiguration
the configuration of the doclet.
configuration
,
ModuleElement
Module under consideration.
mdle
)

Constructor to construct ModuleWriter object and to generate "moduleName-summary.html" file.

Method Summary

Modifier and TypeMethod and Description
public void
addDeprecationInfo(Content
the content to which the deprecation information will be added
div
)

Add the module deprecation information to the documentation tree.

public void
addIndirectPackages(Table<?>
the table to which the content rows will be added
table
,
Map<ModuleElement, SortedSet<PackageElement>>
indirect packages to be added
ip
,
Predicate<ModuleElement> acceptModule)

Add the indirect packages for the module being documented.

protected void
protected void
protected void
protected void
addModuleSignature(Content moduleContent)

private void
addModulesList(Map<ModuleElement, Content>
map of modules and modifiers
mdleMap
,
Table<?>
the table to which the list will be added
table
)

Add the list of modules.

protected void
addModulesSummary(Content summariesList)

public void
addPackageDeprecationInfo(Content
the content to which the deprecation information will be added
li
,
PackageElement
the PackageDoc that is added
pkg
)

Add the module package deprecation information to the documentation tree.

protected void
addPackagesSummary(Content summariesList)

public void
addPackageSummary(HtmlTree
the tree to which the summary will be added
li
)

Add the package summary for the module.

public void
addProvidesList(Table<?>
the table to which the services provided will be added
table
)

Add the provides list for the module.

protected void
addServicesSummary(Content summariesList)

public void
addSummaryHeader(Content
the marker comment
startMarker
,
Content
the heading for the section
heading
,
Content
the content to which the information is added
target
)

Add the summary header.

public void
addUsesList(Table<?>
the table to which the services used will be added
table
)

Add the uses list for the module.

protected void
buildContent()

Build the content for the module doc.

protected void
buildModuleDescription(Content
the content to which the module description will be added
moduleContent
)

Builds the description for this module.

protected void
buildModuleDoc()

Build the module documentation.

protected void
buildModulesSummary(Content
the list of summaries to which the summary will be added
summariesList
)

Builds the summary of the module dependencies of this module.

protected void
buildPackagesSummary(Content
the list of summaries to which the summary will be added
summariesList
)

Builds the summary of the packages exported or opened by this module.

public void
buildPage()

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

The top-level method to generate and write the page represented by this writer.

protected void
buildServicesSummary(Content
the list of summaries to which the summary will be added
summariesList
)

Builds the summary of the services used or provided by this module.

protected void
buildSummary(Content
the module content to which the summaries will be added
target
)

Builds the list of summary sections for this module.

public void
computeModulesData()

Compute the modules data that will be displayed in various tables on the module summary page.

public boolean

Returns:

true if there are elements to be displayed
display
(Set<? extends Element>
set of elements
section
)

Returns true if there are elements to be displayed.

public boolean

Returns:

true if there are elements to be displayed
display
(Map<? extends Element, ?>
map of elements.
section
)

Returns true if there are elements to be displayed.

private boolean
private boolean
protected Content
protected Content
private Content
protected Content
protected Content
private Table<?>

Returns:

a content object
getTable2
(Content
the table caption
caption
,
TableHeader
the table header
tableHeader
)

Get a table, with two columns.

private Table<?>

Returns:

a content object
getTable3
(Content
the table caption
caption
,
TableHeader
the table header
tableHeader
)

Get a table, with three columns, with the second column being the defining column.

private boolean
private boolean
public boolean
isIndexable()

Overrides jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter.isIndexable.

Returns true if the page written by this writer should be indexed, false otherwise.

private boolean
protected void
public boolean

Returns:

true if the element should be documented
shouldDocument
(Element
the element to be checked
element
)

Returns true if the element should be documented on the module summary page.

Inherited from jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter:
addInlineCommentaddInlineCommentaddInlineDeprecatedCommentaddPreQualifiedClassLinkaddPreQualifiedClassLinkaddPreQualifiedStrongClassLinkaddPreviewCommentaddPreviewInfoaddPreviewSummaryaddRestrictedInfoaddRestrictedSummaryaddSrcLinkaddSummaryCommentaddSummaryCommentaddSummaryDeprecatedCommentaddTagsInfocommentTagsToContentcommentTagsToContentcommentTagsToContentcreateTableOfContentsgetAnnotationInfogetAnnotationInfogetAnnotationsgetBlockTagOutputgetBlockTagOutputgetBodygetBodyStylegetCrossClassLinkgetCrossModuleLinkgetCrossPackageLinkgetCurrentTypeElementgetDeprecatedPhrasegetDescriptiongetDocLinkgetDocLinkgetDocLinkgetDocLinkgetDocLinkgetEnclosingPackageNamegetFileTitlegetFootergetGeneratorgetHeadergetHeadergetLinkgetLocalizedPackageNamegetLocalStylesheetsgetModuleLinkgetModuleLinkgetNavBargetNavLinkToOverviewTreegetPackageLabelgetPackageLinkgetPackageLinkgetPackageTableHeadergetPreQualifiedClassLinkgetQualifiedClassLinkgetTagletWriterInstancegetTagletWriterInstancegetTypeParameterLinksgetWindowTitlehasSerializationOverviewTagsignoreNonInlineTaginvalidTagOutputpathStringpathStringprintHtmlDocumentprintHtmlDocumentprintHtmlDocumentreplaceDocRootDirresolveExternalSpecURIwriteGenerating

Field Detail

bodyContentsback to summary
private final BodyContents bodyContents
indirectModulesback to summary
private final Map<ModuleElement, Content> indirectModules

Map of indirect modules and modifiers, transitive closure, required by this module.

indirectOpenPackagesback to summary
private final Map<ModuleElement, SortedSet<PackageElement>> indirectOpenPackages

Map of indirect modules (transitive closure) and their open packages.

indirectPackagesback to summary
private final Map<ModuleElement, SortedSet<PackageElement>> indirectPackages

Map of indirect modules (transitive closure) and their exported packages.

mdleback to summary
protected ModuleElement mdle

The module being documented.

moduleModeback to summary
private final DocletEnvironment.ModuleMode moduleMode

The module mode for this javadoc run. It can be set to "api" or "all".

packagesback to summary
private final Map<PackageElement, ModuleWriter.PackageEntry> packages

Map of packages of this module, and details of whether they are exported or opened.

providesback to summary
private final Map<TypeElement, SortedSet<TypeElement>> provides

Map of services provided by this module, and set of its implementations.

providesTreesback to summary
private final Map<TypeElement, Content> providesTrees

Map of services provided by the module and specified using @provides javadoc tag, and description.

requiresback to summary
private final Map<ModuleElement, Content> requires

Map of module elements and modifiers required by this module.

usesback to summary
private final SortedSet<TypeElement> uses

Set of services used by the module.

usesTreesback to summary
private final Map<TypeElement, Content> usesTrees

Map of services used by the module and specified using @uses javadoc tag, and description.

Constructor Detail

ModuleWriterback to summary
public ModuleWriter(HtmlConfiguration configuration, ModuleElement mdle)

Constructor to construct ModuleWriter object and to generate "moduleName-summary.html" file.

Parameters
configuration:HtmlConfiguration

the configuration of the doclet.

mdle:ModuleElement

Module under consideration.

Method Detail

addDeprecationInfoback to summary
public void addDeprecationInfo(Content div)

Add the module deprecation information to the documentation tree.

Parameters
div:Content

the content to which the deprecation information will be added

addIndirectPackagesback to summary
public void addIndirectPackages(Table<?> table, Map<ModuleElement, SortedSet<PackageElement>> ip, Predicate<ModuleElement> acceptModule)

Add the indirect packages for the module being documented.

Parameters
table:Table<?>

the table to which the content rows will be added

ip:Map<ModuleElement, SortedSet<PackageElement>>

indirect packages to be added

addModuleContentback to summary
protected void addModuleContent(Content source)
addModuleDescriptionback to summary
protected void addModuleDescription(Content moduleContent)
addModuleFooterback to summary
protected void addModuleFooter()
addModuleSignatureback to summary
protected void addModuleSignature(Content moduleContent)
addModulesListback to summary
private void addModulesList(Map<ModuleElement, Content> mdleMap, Table<?> table)

Add the list of modules.

Parameters
mdleMap:Map<ModuleElement, Content>

map of modules and modifiers

table:Table<?>

the table to which the list will be added

addModulesSummaryback to summary
protected void addModulesSummary(Content summariesList)
addPackageDeprecationInfoback to summary
public void addPackageDeprecationInfo(Content li, PackageElement pkg)

Add the module package deprecation information to the documentation tree.

Parameters
li:Content

the content to which the deprecation information will be added

pkg:PackageElement

the PackageDoc that is added

addPackagesSummaryback to summary
protected void addPackagesSummary(Content summariesList)
addPackageSummaryback to summary
public void addPackageSummary(HtmlTree li)

Add the package summary for the module.

Parameters
li:HtmlTree

the tree to which the summary will be added

addProvidesListback to summary
public void addProvidesList(Table<?> table)

Add the provides list for the module.

Parameters
table:Table<?>

the table to which the services provided will be added

addServicesSummaryback to summary
protected void addServicesSummary(Content summariesList)
addSummaryHeaderback to summary
public void addSummaryHeader(Content startMarker, Content heading, Content target)

Add the summary header.

Parameters
startMarker:Content

the marker comment

heading:Content

the heading for the section

target:Content

the content to which the information is added

addUsesListback to summary
public void addUsesList(Table<?> table)

Add the uses list for the module.

Parameters
table:Table<?>

the table to which the services used will be added

buildContentback to summary
protected void buildContent()

Build the content for the module doc.

buildModuleDescriptionback to summary
protected void buildModuleDescription(Content moduleContent)

Builds the description for this module.

Parameters
moduleContent:Content

the content to which the module description will be added

buildModuleDocback to summary
protected void buildModuleDoc() throws DocletException

Build the module documentation.

Exceptions
DocletException:
if there is a problem while building the documentation
buildModulesSummaryback to summary
protected void buildModulesSummary(Content summariesList)

Builds the summary of the module dependencies of this module.

Parameters
summariesList:Content

the list of summaries to which the summary will be added

buildPackagesSummaryback to summary
protected void buildPackagesSummary(Content summariesList)

Builds the summary of the packages exported or opened by this module.

Parameters
summariesList:Content

the list of summaries to which the summary will be added

buildPageback to summary
public void buildPage() throws DocletException

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

Doc from jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter.buildPage.

The top-level method to generate and write the page represented by this writer.

Annotations
@Override
Exceptions
DocletException:
if a problem occurs while building or writing the page
buildServicesSummaryback to summary
protected void buildServicesSummary(Content summariesList)

Builds the summary of the services used or provided by this module.

Parameters
summariesList:Content

the list of summaries to which the summary will be added

buildSummaryback to summary
protected void buildSummary(Content target)

Builds the list of summary sections for this module.

Parameters
target:Content

the module content to which the summaries will be added

computeModulesDataback to summary
public void computeModulesData()

Compute the modules data that will be displayed in various tables on the module summary page.

displayback to summary
public boolean display(Set<? extends Element> section)

Returns true if there are elements to be displayed.

Parameters
section:Set<? extends Element>

set of elements

Returns:boolean

true if there are elements to be displayed

displayback to summary
public boolean display(Map<? extends Element, ?> section)

Returns true if there are elements to be displayed.

Parameters
section:Map<? extends Element, ?>

map of elements.

Returns:boolean

true if there are elements to be displayed

displayServiceDirectiveback to summary
private boolean displayServiceDirective(TypeElement typeElement, Map<TypeElement, Content> tagsMap)
displayServicesback to summary
private boolean displayServices(Set<TypeElement> typeElements, Map<TypeElement, Content> tagsMap)
getContentHeaderback to summary
protected Content getContentHeader()
getModuleHeaderback to summary
protected Content getModuleHeader(String heading)
getPackageExportOpensToback to summary
private Content getPackageExportOpensTo(Set<ModuleElement> modules)
getSummariesListback to summary
protected Content getSummariesList()
getSummaryback to summary
protected Content getSummary(Content source)
getTable2back to summary
private Table<?> getTable2(Content caption, TableHeader tableHeader)

Get a table, with two columns.

Parameters
caption:Content

the table caption

tableHeader:TableHeader

the table header

Returns:Table<?>

a content object

getTable3back to summary
private Table<?> getTable3(Content caption, TableHeader tableHeader)

Get a table, with three columns, with the second column being the defining column.

Parameters
caption:Content

the table caption

tableHeader:TableHeader

the table header

Returns:Table<?>

a content object

isConcealedback to summary
private boolean isConcealed(Element e)
isExportedback to summary
private boolean isExported(Element e)
isIndexableback to summary
public boolean isIndexable()

Overrides jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter.isIndexable.

Doc from jdk.javadoc.internal.doclets.formats.html.HtmlDocletWriter.isIndexable.

Returns true if the page written by this writer should be indexed, false otherwise. Some pages merely aggregate filtered information available on other pages and, thus, have no indexing value. In fact, if indexed, they would clutter the index and mislead the reader.

Annotations
@Override
isOpenedback to summary
private boolean isOpened(Element e)
printDocumentback to summary
protected void printDocument(Content content) throws DocFileIOException
shouldDocumentback to summary
public boolean shouldDocument(Element element)

Returns true if the element should be documented on the module summary page.

Parameters
element:Element

the element to be checked

Returns:boolean

true if the element should be documented

jdk.javadoc.internal.doclets.formats.html back to summary

pack-priv Class ModuleWriter.PackageEntry

extends Object
Class Inheritance
  • java.lang.Object
  • jdk.javadoc.internal.doclets.formats.html.ModuleWriter.PackageEntry

Details about a package in a module. A package may be not exported, or exported to some modules, or exported to all modules. A package may be not opened, or opened to some modules, or opened to all modules. A package that is neither exported or opened to any modules is a concealed package. An open module opens all its packages to all modules.

Field Summary

Modifier and TypeField and Description
pack-priv Set<ModuleElement>
exportedTo

Summary of package exports: If null, the package is not exported to any modules; if empty, the package is exported to all modules; otherwise, the package is exported to these modules.

pack-priv Set<ModuleElement>
openedTo

Summary of package opens: If null, the package is not opened to any modules; if empty, the package is opened to all modules; otherwise, the package is opened to these modules.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

exportedToback to summary
pack-priv Set<ModuleElement> exportedTo

Summary of package exports: If null, the package is not exported to any modules; if empty, the package is exported to all modules; otherwise, the package is exported to these modules.

openedToback to summary
pack-priv Set<ModuleElement> openedTo

Summary of package opens: If null, the package is not opened to any modules; if empty, the package is opened to all modules; otherwise, the package is opened to these modules.

Constructor Detail

PackageEntryback to summary
pack-priv PackageEntry()