Jump to content

Template:Javadoc/doc

From Wikipedia, the free encyclopedia

A template to link to the JDK documentation. A more up-to-date version of {{Javadoc:SE}} and {{Javadoc:EE}}.

Usage

[edit]

An empty usage just links to the javadocs: {{Javadoc}}Java SE 20 Javadocs

Linking to a module: {{Javadoc|module=java.base}}java.base

Linking to a package in that module: {{Javadoc|module=java.base|package=java.lang}}java.lang

For java.lang.Object, write {{Javadoc|module=java.base|package=java.lang|class=Object}}java.lang.Object

To link to a particular class member, write {{Javadoc|module=java.base|package=java.lang|class=Object|member=clone()}}java.lang.Object#clone()

Overriding the text: {{Javadoc|module=java.base|package=java.lang|class=Object|member=clone()|text=clone()}}clone()

A monospaced font can be used by writing {{Javadoc|module=java.base|package=java.lang|class=Object|monotype=y}}java.lang.Object

Linking to a particular version can be done, too: {{Javadoc|version=11}}Java SE 11 Javadocs

Parameters

[edit]
module
A module (e.g. 'java.base').
package
A package path (e.g. 'java.lang'). Different from module. Requires all the parameters above.
class
The class to link to. Requires all the parameters above.
member
A member (method or field) that is part of the class. Requires all the parameters above.
version
The Java version number to link to (11 and up).
text
The text to override the default link text.
monotype
Whether to surround the link with <code> tags.

Templatedata

[edit]
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Javadoc in articles based on its TemplateData.

TemplateData for Javadoc

No description.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
JDK versionversion

The version of the JDK to link to (11 and up)

Example
15
Numberoptional
Modulemodule

The module to link to

Suggested values
java.base java.compiler java.datatransfer java.desktop java.instrument java.logging java.management java.management.rmi java.naming java.net.http java.prefs java.rmi java.scripting java.se java.security.jgss java.security.sasl java.smartcardio java.sql java.sql.rowset java.transaction.xa java.xml java.xml.crypto
Example
java.base
Stringsuggested
Packagepackage

The package to link to (requires module)

Example
java.lang
Stringsuggested
Classclass

The class to link to (requires module and package)

Example
Object
Stringsuggested
Membermember

Link to a member in the class (requires class, package, and module)

Example
clone()
Stringoptional
Override texttext

Overrides the link's text

Stringsuggested
Monospaced fontmonotype

Makes the font monospaced rather than normal text

Auto value
y
Booleanoptional