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

public Class HtmlConfiguration

extends BaseConfiguration
Class Inheritance
Imports
java.io.BufferedReader, .File, .IOException, .InputStream, .InputStreamReader, java.nio.file.InvalidPathException, .Path, java.time.ZonedDateTime, java.util.ArrayList, .Arrays, .EnumSet, .HashMap, .HashSet, .List, .Locale, .Map, .Objects, .Set, java.util.function.Function, java.util.regex.Pattern, java.util.stream.Collectors, javax.lang.model.element.Element, .PackageElement, .TypeElement, javax.tools.DocumentationTool, .JavaFileManager, .JavaFileObject, .StandardJavaFileManager, jdk.javadoc.doclet.Doclet, .DocletEnvironment, .Reporter, .StandardDoclet, .Taglet, jdk.javadoc.internal.Versions, jdk.javadoc.internal.doclets.formats.html.taglets.TagletManager, jdk.javadoc.internal.doclets.toolkit.BaseConfiguration, .BaseOptions, .DocletException, .Messages, .Resources, jdk.javadoc.internal.doclets.toolkit.util.DeprecatedAPIListBuilder, .DocFile, .DocFileIOException, .DocPath, .DocPaths, .NewAPIBuilder, .PreviewAPIListBuilder, .RestrictedAPIListBuilder, .SimpleDocletException

Configure the output based on the command-line options.

Also determine the length of the command-line option. For example, for a option "-header" there will be a string argument associated, then the the length of option "-header" is two. But for option "-nohelp" no argument is needed so it's length is 1.

Also do the error checking on the options used. For example it is illegal to use "-helpfile" option when already "-nohelp" option is used.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
HtmlConfiguration.ConditionalPage

Kinds of conditional pages.

public static record
HtmlConfiguration.JavaScriptFile

Record for JavaScript file and module flag.

Field Summary

Modifier and TypeField and Description
private List<HtmlConfiguration.JavaScriptFile>
additionalScripts

List of additional JavaScript files

private ZonedDateTime
buildDate

The build date, to be recorded in generated files.

public final Set<HtmlConfiguration.ConditionalPage>
conditionalPages

A set of values indicating which conditional pages should be generated.

private final Set<PackageElement>
containingPackagesSeen

The set of packages for which we have copied the doc files.

public Contents
protected DeprecatedAPIListBuilder
deprecatedAPIListBuilder

The collection of deprecated items, if any, to be displayed on the deprecated-list page, or null if the page should not be generated.

private final Runtime.Version
public DocPaths
public final Resources
public static final String
HTML_DEFAULT_CHARSET

Default charset for HTML.

public HtmlIds
public HtmlIndexBuilder
indexBuilder

The collections of items for the main index.

public Map<Element, List<DocPath>>
public final Messages
protected NewAPIBuilder
newAPIPageBuilder

The collection of new API items, if any, to be displayed on the new-list page, or null if the page should not be generated.

private final HtmlOptions
protected PreviewAPIListBuilder
previewAPIListBuilder

The collection of preview items, if any, to be displayed on the preview-list page, or null if the page should not be generated.

protected RestrictedAPIListBuilder
restrictedAPIListBuilder

The collection of restricted methods, if any, to be displayed on the restricted-list page, or null if the page should not be generated.

public TagletManager
tagletManager

The taglet manager.

public DocPath
topFile

First file to appear in the right-hand frame in the generated documentation.

Inherited from jdk.javadoc.internal.doclets.toolkit.BaseConfiguration:
cmtUtilsdocEnvdocFileFactorydocletdoclintexterngrouplocalemetakeywordsmodulePackagesmodulesoverviewElementpackagespropertyUtilsreportersharedResourceBundleNameshowModulessourcepathtypeElementCatalogutilsworkArounds

Constructor Summary

AccessConstructor and Description
public
HtmlConfiguration(Doclet
the doclet for this run of javadoc
doclet
,
Locale
the locale for the generated documentation
locale
,
Reporter
the reporter to use for console messages
reporter
)

Constructs the full configuration needed by the doclet, including the format-specific part, defined in this class, and the format-independent part, defined in the supertype.

Method Summary

Modifier and TypeMethod and Description
private HtmlConfiguration.JavaScriptFile
public boolean
finishOptionSettings()

Implements abstract jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.finishOptionSettings.

This method should be defined in all those doclets (configurations), which want to derive themselves from this BaseConfiguration.

protected boolean
public List<HtmlConfiguration.JavaScriptFile>
public List<DocPath>
public ZonedDateTime

Returns:

the date to be recorded in generated files
getBuildDate
()

Returns the date to be recorded in generated files.

public Set<PackageElement>

Returns:

the packages for which we have copied the doc files
getContainingPackagesSeen
()

Returns the packages for which we have copied the doc files.

public Contents

Returns:

a utility object providing commonly used fragments of content
getContents
()

Returns a utility object providing commonly used fragments of content.

public Runtime.Version
public Resources
public JavaFileManager
getFileManager()

Implements abstract jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.getFileManager.

Return the current file manager.

public Locale
getLocale()

Implements abstract jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.getLocale.

Return the Locale for this document.

public DocPath
public Messages
public HtmlOptions
public JavaFileObject

Returns:

the path of the overview file or null if it does not exist.
getOverviewPath
()

Implements abstract jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.getOverviewPath.

Return the path of the overview file or null if it does not exist.

protected TypeElement
public WriterFactory
protected void
private void
initTagletManager(Set<List<String>>
the set two-dimensional arrays of strings. These arrays contain either -tag or -taglet arguments.
customTagStrs
)

Initialize the taglet manager.

protected void
setCreateOverview()

Generate "overview.html" page if option "-overview" is used or number of packages is more than one.

protected void
setTopFile()

Decide the page which will appear first in the right-hand frame.

private List<String>

Returns:

an array of tokens
tokenize
(String
the string to tokenize
s
,
int
the maximum number of tokens returned. If the max is reached, the remaining part of s is appended to the end of the last token.
maxTokens
)

Given a string, return an array of tokens, separated by ':'.

Inherited from jdk.javadoc.internal.doclets.toolkit.BaseConfiguration:
getClassNamegetIncludedModuleElementsgetIncludedPackageElementsgetIncludedTypeElementsgetReportergetSpecifiedModuleElementsgetSpecifiedPackageElementsgetSpecifiedTypeElementsgetVisibleMemberTableinitDocLintisAllowScriptInCommentsisDocLintReferenceGroupEnabledisDocLintSyntaxGroupEnabledisGeneratedDocisJavaFXModerunDocLintsetOptionsshouldExcludeDocFileDirshouldExcludeQualifier

Field Detail

additionalScriptsback to summary
private List<HtmlConfiguration.JavaScriptFile> additionalScripts

List of additional JavaScript files

buildDateback to summary
private ZonedDateTime buildDate

The build date, to be recorded in generated files.

conditionalPagesback to summary
public final Set<HtmlConfiguration.ConditionalPage> conditionalPages

A set of values indicating which conditional pages should be generated. The set is computed lazily, although values must (obviously) be set before they are required, such as when deciding whether to generate links to these files in the navigation bar, on each page, the help file, and so on. The value for any page may depend on both command-line options to enable or disable a page, and on content being found for the page, such as deprecated items to appear in the summary page of deprecated items.

containingPackagesSeenback to summary
private final Set<PackageElement> containingPackagesSeen

The set of packages for which we have copied the doc files.

contentsback to summary
public Contents contents
deprecatedAPIListBuilderback to summary
protected DeprecatedAPIListBuilder deprecatedAPIListBuilder

The collection of deprecated items, if any, to be displayed on the deprecated-list page, or null if the page should not be generated. The page will not be generated if no deprecated items are to be included in the documentation, or if the page is not wanted, or if there are no deprecated elements being documented.

docletVersionback to summary
private final Runtime.Version docletVersion
docPathsback to summary
public DocPaths docPaths
docResourcesback to summary
public final Resources docResources
HTML_DEFAULT_CHARSETback to summary
public static final String HTML_DEFAULT_CHARSET

Default charset for HTML.

htmlIdsback to summary
public HtmlIds htmlIds
indexBuilderback to summary
public HtmlIndexBuilder indexBuilder

The collections of items for the main index. This field is only initialized if options.createIndex() is true. This index is populated somewhat lazily: 1. items found in doc comments are found while generating declaration pages 2. items for elements are added in bulk before generating the index files 3. additional items are added as needed

localStylesheetMapback to summary
public Map<Element, List<DocPath>> localStylesheetMap
messagesback to summary
public final Messages messages
newAPIPageBuilderback to summary
protected NewAPIBuilder newAPIPageBuilder

The collection of new API items, if any, to be displayed on the new-list page, or null if the page should not be generated. The page is only generated if the --since option is used with release names matching @since tags in the documented code.

optionsback to summary
private final HtmlOptions options
previewAPIListBuilderback to summary
protected PreviewAPIListBuilder previewAPIListBuilder

The collection of preview items, if any, to be displayed on the preview-list page, or null if the page should not be generated. The page will not be generated if there are no preview elements being documented.

restrictedAPIListBuilderback to summary
protected RestrictedAPIListBuilder restrictedAPIListBuilder

The collection of restricted methods, if any, to be displayed on the restricted-list page, or null if the page should not be generated. The page will not be generated if there are no restricted methods to be documented.

tagletManagerback to summary
public TagletManager tagletManager

The taglet manager.

topFileback to summary
public DocPath topFile

First file to appear in the right-hand frame in the generated documentation.

Constructor Detail

HtmlConfigurationback to summary
public HtmlConfiguration(Doclet doclet, Locale locale, Reporter reporter)

Constructs the full configuration needed by the doclet, including the format-specific part, defined in this class, and the format-independent part, defined in the supertype.

API Note

The doclet parameter is used when initializing tags. Some doclets (such as the StandardDoclet), may delegate to another (such as the HtmlDoclet). In such cases, the primary doclet (i.e StandardDoclet) should be provided here, and not any internal class like HtmlDoclet.

Parameters
doclet:Doclet

the doclet for this run of javadoc

locale:Locale

the locale for the generated documentation

reporter:Reporter

the reporter to use for console messages

Method Detail

detectJSModuleback to summary
private HtmlConfiguration.JavaScriptFile detectJSModule(String fileName)
finishOptionSettingsback to summary
public boolean finishOptionSettings()

Implements abstract jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.finishOptionSettings.

Doc from jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.finishOptionSettings.

This method should be defined in all those doclets (configurations), which want to derive themselves from this BaseConfiguration. This method can be used to finish up the options setup.

Annotations
@Override
finishOptionSettings0back to summary
protected boolean finishOptionSettings0() throws DocletException

Overrides jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.finishOptionSettings0.

Annotations
@Override
getAdditionalScriptsback to summary
public List<HtmlConfiguration.JavaScriptFile> getAdditionalScripts()
getAdditionalStylesheetsback to summary
public List<DocPath> getAdditionalStylesheets()
getBuildDateback to summary
public ZonedDateTime getBuildDate()

Returns the date to be recorded in generated files.

Returns:ZonedDateTime

the date to be recorded in generated files

getContainingPackagesSeenback to summary
public Set<PackageElement> getContainingPackagesSeen()

Returns the packages for which we have copied the doc files.

Returns:Set<PackageElement>

the packages for which we have copied the doc files

See Also
ClassWriter#copyDocFiles()
getContentsback to summary
public Contents getContents()

Returns a utility object providing commonly used fragments of content.

Returns:Contents

a utility object providing commonly used fragments of content

getDocletVersionback to summary
public Runtime.Version getDocletVersion()

Implements abstract jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.getDocletVersion.

Doc from jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.getDocletVersion.

Returns the version of the doclet.

Annotations
@Override
getDocResourcesback to summary
public Resources getDocResources()

Implements abstract jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.getDocResources.

Annotations
@Override
getFileManagerback to summary
public JavaFileManager getFileManager()

Implements abstract jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.getFileManager.

Doc from jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.getFileManager.

Return the current file manager.

Annotations
@Override
getLocaleback to summary
public Locale getLocale()

Implements abstract jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.getLocale.

Doc from jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.getLocale.

Return the Locale for this document.

Annotations
@Override
getMainStylesheetback to summary
public DocPath getMainStylesheet()
getMessagesback to summary
public Messages getMessages()

Implements abstract jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.getMessages.

Annotations
@Override
getOptionsback to summary
public HtmlOptions getOptions()

Implements abstract jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.getOptions.

Annotations
@Override
getOverviewPathback to summary
public JavaFileObject getOverviewPath()

Implements abstract jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.getOverviewPath.

Return the path of the overview file or null if it does not exist.

Returns:JavaFileObject

the path of the overview file or null if it does not exist.

Annotations
@Override
getValidClassback to summary
protected TypeElement getValidClass(List<TypeElement> classes)
getWriterFactoryback to summary
public WriterFactory getWriterFactory()
initConfigurationback to summary
protected void initConfiguration(DocletEnvironment docEnv, Function<String, String> resourceKeyMapper)

Overrides jdk.javadoc.internal.doclets.toolkit.BaseConfiguration.initConfiguration.

Annotations
@Override
initTagletManagerback to summary
private void initTagletManager(Set<List<String>> customTagStrs)

Initialize the taglet manager. The strings to initialize the simple custom tags should be in the following format: "[tag name]:[location str]:[heading]".

Parameters
customTagStrs:Set<List<String>>

the set two-dimensional arrays of strings. These arrays contain either -tag or -taglet arguments.

setCreateOverviewback to summary
protected void setCreateOverview()

Generate "overview.html" page if option "-overview" is used or number of packages is more than one. Sets HtmlOptions.createOverview field to true.

setTopFileback to summary
protected void setTopFile()

Decide the page which will appear first in the right-hand frame. It will be "overview-summary.html" if "-overview" option is used or no "-overview" but the number of packages is more than one. It will be "package-summary.html" of the respective package if there is only one package to document. It will be a class page(first in the sorted order), if only classes are provided on the command line.

tokenizeback to summary
private List<String> tokenize(String s, int maxTokens)

Given a string, return an array of tokens, separated by ':'. The separator character can be escaped with the '\' character. The '\' character may also be escaped with the '\' character.

Parameters
s:String

the string to tokenize

maxTokens:int

the maximum number of tokens returned. If the max is reached, the remaining part of s is appended to the end of the last token.

Returns:List<String>

an array of tokens

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

public final Enum HtmlConfiguration.ConditionalPage

extends Enum<HtmlConfiguration.ConditionalPage>
Class Inheritance

Kinds of conditional pages.

Field Summary

Modifier and TypeField and Description
public static final HtmlConfiguration.ConditionalPage
public static final HtmlConfiguration.ConditionalPage
public static final HtmlConfiguration.ConditionalPage
public static final HtmlConfiguration.ConditionalPage
public static final HtmlConfiguration.ConditionalPage
public static final HtmlConfiguration.ConditionalPage
public static final HtmlConfiguration.ConditionalPage
public static final HtmlConfiguration.ConditionalPage
public static final HtmlConfiguration.ConditionalPage

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static HtmlConfiguration.ConditionalPage
public static HtmlConfiguration.ConditionalPage[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CONSTANT_VALUESback to summary
public static final HtmlConfiguration.ConditionalPage CONSTANT_VALUES
DEPRECATEDback to summary
public static final HtmlConfiguration.ConditionalPage DEPRECATED
EXTERNAL_SPECSback to summary
public static final HtmlConfiguration.ConditionalPage EXTERNAL_SPECS
NEWback to summary
public static final HtmlConfiguration.ConditionalPage NEW
PREVIEWback to summary
public static final HtmlConfiguration.ConditionalPage PREVIEW
RESTRICTEDback to summary
public static final HtmlConfiguration.ConditionalPage RESTRICTED
SEARCH_TAGSback to summary
public static final HtmlConfiguration.ConditionalPage SEARCH_TAGS
SERIALIZED_FORMback to summary
public static final HtmlConfiguration.ConditionalPage SERIALIZED_FORM
SYSTEM_PROPERTIESback to summary
public static final HtmlConfiguration.ConditionalPage SYSTEM_PROPERTIES

Constructor Detail

ConditionalPageback to summary
private ConditionalPage()

Method Detail

valueOfback to summary
public static HtmlConfiguration.ConditionalPage valueOf(String name)
valuesback to summary
public static HtmlConfiguration.ConditionalPage[] values()
jdk.javadoc.internal.doclets.formats.html back to summary

public final Record HtmlConfiguration.JavaScriptFile

extends Record
Class Inheritance
Record Components
path:DocPath
file path
isModule:boolean
module flag

Record for JavaScript file and module flag.

Field Summary

Modifier and TypeField and Description
private final boolean
isModule

Record Component accessed by isModule().

module flag
private final DocPath
path

Record Component accessed by path().

file path

Constructor Summary

AccessConstructor and Description
public
JavaScriptFile(DocPath path, boolean isModule)

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public boolean
isModule()

Record Component getter of isModule.

Record Component module flag

public DocPath
path()

Record Component getter of path.

Record Component file path

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

isModuleback to summary
private final boolean isModule

Record Component accessed by isModule().

module flag

pathback to summary
private final DocPath path

Record Component accessed by path().

file path

Constructor Detail

JavaScriptFileback to summary
public JavaScriptFile(DocPath path, boolean isModule)

Method Detail

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

isModuleback to summary
public boolean isModule()

Record Component getter of isModule.

Record Component
module flag
pathback to summary
public DocPath path()

Record Component getter of path.

Record Component
file path
toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.