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

public Class HtmlLinkFactory

extends Object
Class Inheritance
Imports
java.util.ArrayDeque, .ArrayList, .EnumSet, .List, .Set, javax.lang.model.element.AnnotationMirror, .Element, .ExecutableElement, .TypeElement, .TypeParameterElement, javax.lang.model.type.ArrayType, .DeclaredType, .TypeMirror, .TypeVariable, .WildcardType, javax.lang.model.util.SimpleTypeVisitor14, jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyles, jdk.javadoc.internal.doclets.toolkit.BaseConfiguration, .Resources, jdk.javadoc.internal.doclets.toolkit.util.DocPath, .DocPaths, .Utils, .Utils.ElementFlag, jdk.javadoc.internal.html.Content, .ContentBuilder, .Entity, .HtmlId, .HtmlTree, .Text

A factory that returns a link given the information about it.

Field Summary

Modifier and TypeField and Description
private final DocPaths
private final HtmlDocletWriter
private final Utils

Constructor Summary

AccessConstructor and Description
public
HtmlLinkFactory(HtmlDocletWriter
the HTML doclet writer
writer
)

Constructs a new link factory.

Method Summary

Modifier and TypeMethod and Description
private void
addSuperscript(Content
the content to add to
content
,
Set<Utils.ElementFlag>
the flags
flags
,
DocPath
file name to link to, or null if no local link target
fileName
,
TypeElement
external type to link to, or null if no external link
typeElement
,
Element
preview link target element
previewTarget
,
ExecutableElement
restricted link target element
restrictedTarget
)

Adds PREVIEW and RESTRICTED superscript labels.

private HtmlLinkInfo
private String

Returns:

the tool tip for the appropriate class.
getClassToolTip
(TypeElement
the class to get the tool tip for.
typeElement
,
boolean
true if link target is a type parameter
isTypeParamLink
)

Given a class, return the appropriate tool tip.

private DocPath
getPath(HtmlLinkInfo
the information about the link.
linkInfo
)

Return path to the given file name in the given package.

private Content

Returns:

superscript content
getSuperscript
(DocPath
local file name to link to, or null if no local link target
fileName
,
TypeElement
external type to link to, or null if no external link
typeElement
,
HtmlId
the id fragment to link to
id
,
Content
the label content
label
)

Returns PREVIEW or RESTRICTED superscript as either local or external link or as plain text.

protected Content

Returns:

a new instance of a content object
newContent
()

Returns a new instance of a content object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

docPathsback to summary
private final DocPaths docPaths
m_writerback to summary
private final HtmlDocletWriter m_writer
utilsback to summary
private final Utils utils

Constructor Detail

HtmlLinkFactoryback to summary
public HtmlLinkFactory(HtmlDocletWriter writer)

Constructs a new link factory.

Parameters
writer:HtmlDocletWriter

the HTML doclet writer

Method Detail

addSuperscriptback to summary
private void addSuperscript(Content content, Set<Utils.ElementFlag> flags, DocPath fileName, TypeElement typeElement, Element previewTarget, ExecutableElement restrictedTarget)

Adds PREVIEW and RESTRICTED superscript labels. Depending on the parameter values, labels will be formatted as local or external links or plain text.

Parameters
content:Content

the content to add to

flags:Set<Utils.ElementFlag>

the flags

fileName:DocPath

file name to link to, or null if no local link target

typeElement:TypeElement

external type to link to, or null if no external link

previewTarget:Element

preview link target element

restrictedTarget:ExecutableElement

restricted link target element

getBoundsLinkInfoback to summary
private HtmlLinkInfo getBoundsLinkInfo(HtmlLinkInfo linkInfo, TypeMirror bound)
getClassToolTipback to summary
private String getClassToolTip(TypeElement typeElement, boolean isTypeParamLink)

Given a class, return the appropriate tool tip.

Parameters
typeElement:TypeElement

the class to get the tool tip for.

isTypeParamLink:boolean

true if link target is a type parameter

Returns:String

the tool tip for the appropriate class.

getPathback to summary
private DocPath getPath(HtmlLinkInfo linkInfo)

Return path to the given file name in the given package. So if the name passed is "Object.html" and the name of the package is "java.lang", and if the relative path is "../.." then returned string will be "../../java/lang/Object.html"

Parameters
linkInfo:HtmlLinkInfo

the information about the link.

getSuperscriptback to summary
private Content getSuperscript(DocPath fileName, TypeElement typeElement, HtmlId id, Content label)

Returns PREVIEW or RESTRICTED superscript as either local or external link or as plain text.

Parameters
fileName:DocPath

local file name to link to, or null if no local link target

typeElement:TypeElement

external type to link to, or null if no external link

id:HtmlId

the id fragment to link to

label:Content

the label content

Returns:Content

superscript content

newContentback to summary
protected Content newContent()

Returns a new instance of a content object.

Returns:Content

a new instance of a content object