Klasse Head
Many methods return the current object, to facilitate fluent builder-style usage.
-
Konstruktorübersicht
KonstruktorBeschreibungHead
(DocPath path, Runtime.Version docletVersion, ZonedDateTime generatedDate) Creates a Head object, for a given file and HTML version. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungaddContent
(Content... contents) Adds additional content to be included in the HEAD element.addDefaultScript
(boolean addDefaultScript) Specifies whether or not to add a reference to a default script to be included in the HEAD element.addKeywords
(List<String> keywords) Adds a list of keywords to appear in META keywords elements.Adds a script to be included in the HEAD element.boolean
isEmpty()
Returns true if the content is empty.setAdditionalScripts
(List<DocPath> scripts) Sets the list of additional script files to be added to the HEAD element.void
setCanonicalLink
(DocPath link) Specifies a value for a canonical link in the element.setCharset
(String charset) Sets the charset to be declared in a META Content-TYPE element.setDescription
(String description) Sets the content for the description META element.setGenerator
(String generator) Sets the content for the generator META element.Sets whether or not to include the supporting scripts and stylesheets for the “search” feature.setStylesheets
(DocPath main, List<DocPath> additional) Sets the main and any additional stylesheets to be listed in the HEAD element.setTimestamp
(boolean timestamp) Sets whether or not timestamps should be recorded in the HEAD element.Sets the title to appear in the TITLE element.boolean
Writes content to a writer, using a given newline sequence, which should be either \n or the platform line separator.
-
Konstruktordetails
-
Head
Creates a Head object, for a given file and HTML version.The file is used to help determine the relative paths to stylesheet and script files. The HTML version is used to determine the appropriate form of a META element recording the time the file was created. The doclet version should also be provided for recording in the file.
- Parameter:
path
- the path for the file that will include this HEAD elementdocletVersion
- the doclet version
-
-
Methodendetails
-
setTitle
Sets the title to appear in the TITLE element.- Parameter:
title
- the title- Gibt zurück:
- this object
-
setCharset
Sets the charset to be declared in a META Content-TYPE element.- Parameter:
charset
- the charset- Gibt zurück:
- this object
-
setDescription
Sets the content for the description META element. -
setGenerator
Sets the content for the generator META element. -
addKeywords
Adds a list of keywords to appear in META keywords elements.- Parameter:
keywords
- the list of keywords, or null if none need to be added- Gibt zurück:
- this object
-
setTimestamp
Sets whether or not timestamps should be recorded in the HEAD element.The timestamp will be recorded in a comment, and in an appropriate META element, depending on the HTML version specified when this object was created.
- Parameter:
timestamp
- true if timestamps should be be added.- Gibt zurück:
- this object
-
setStylesheets
Sets the main and any additional stylesheets to be listed in the HEAD element.The paths for the stylesheets must be relative to the root of the generated documentation hierarchy.
- Parameter:
main
- the main stylesheet, or null to use the defaultadditional
- a list of any additional stylesheets to be included- Gibt zurück:
- this object
-
setAdditionalScripts
Sets the list of additional script files to be added to the HEAD element.The path for the script files must be relative to the root of the generated documentation hierarchy.
- Parameter:
scripts
- the list of additional script files- Gibt zurück:
- this object
-
setIndex
Sets whether or not to include the supporting scripts and stylesheets for the “search” feature.If the feature is enabled, a Script must be provided into which some JavaScript code will be injected, to be executed during page loading. The value will be ignored if the feature is not enabled.
- Parameter:
index
- true if the supporting files are to be includedmainBodyScript
- the Script object, or null- Gibt zurück:
- this object
-
addScript
Adds a script to be included in the HEAD element.- Parameter:
script
- the script- Gibt zurück:
- this object
-
addDefaultScript
Specifies whether or not to add a reference to a default script to be included in the HEAD element.The default script will normally be included; this method may be used to prevent that.
- Parameter:
addDefaultScript
- whether or not a default script will be included- Gibt zurück:
- this object
-
setCanonicalLink
Specifies a value for a canonical link in the element.- Parameter:
link
- the value for the canonical link
-
addContent
Adds additional content to be included in the HEAD element.- Parameter:
contents
- the content- Gibt zurück:
- this object
-
isEmpty
Returns true if the content is empty. -
write
Beschreibung aus Klasse kopiert:Content
Writes content to a writer, using a given newline sequence, which should be either \n or the platform line separator.- Angegeben von:
write
in KlasseContent
- Parameter:
out
- the writernewline
- the newline sequence to useatNewline
- whether the writer has just written a newline- Gibt zurück:
- whether the writer has just written a newline
- Löst aus:
IOException
- if an error occurs while writing the output
-