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

public Class HtmlLinkInfo

extends Object
Class Inheritance
Imports
javax.lang.model.element.Element, .ExecutableElement, .TypeElement, javax.lang.model.type.DeclaredType, .TypeMirror, jdk.javadoc.internal.doclets.toolkit.BaseConfiguration, jdk.javadoc.internal.doclets.toolkit.util.Utils, jdk.javadoc.internal.html.Content, .ContentBuilder, .HtmlStyle, .Text

HTML-specific information about a link.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
HtmlLinkInfo.Kind

Enumeration of different kinds of links.

Field Summary

Modifier and TypeField and Description
private boolean
private final HtmlConfiguration
private HtmlLinkInfo.Kind
private ExecutableElement
private String
private boolean
private Content
private boolean
private boolean
private boolean
private boolean
private boolean
private HtmlStyle
private Element
private String
private TypeMirror
private TypeElement

Constructor Summary

AccessConstructor and Description
public
HtmlLinkInfo(HtmlConfiguration
the configuration data for the doclet
configuration
,
HtmlLinkInfo.Kind
the context of the link.
context
,
ExecutableElement
the member to link to.
ee
)

Construct a LinkInfo object.

public
HtmlLinkInfo(HtmlConfiguration
the configuration data for the doclet
configuration
,
HtmlLinkInfo.Kind
the context of the link.
context
,
TypeElement
the class to link to.
typeElement
)

Construct a LinkInfo object.

public
HtmlLinkInfo(HtmlConfiguration
the configuration data for the doclet
configuration
,
HtmlLinkInfo.Kind
the context of the link.
context
,
TypeMirror
the class to link to.
type
)

Construct a LinkInfo object.

Method Summary

Modifier and TypeMethod and Description
public HtmlLinkInfo

Returns:

this object
addLineBreakOpportunitiesInTypeParameters
(boolean
the new value
addLineBreakOpportunities
)

Sets the addLineBreakOpportunitiesInTypeParameters flag for this link.

public boolean

Returns:

true if line break opportunities should be added to type parameters
addLineBreakOpportunitiesInTypeParameters
()

Returns true if line break opportunities should be added to type parameters.

public HtmlLinkInfo

Returns:

the new link info
forType
(TypeMirror
the type mirror
type
)

Creates a copy of this HtmlLinkInfo instance with a different TypeMirror.

public HtmlLinkInfo

Returns:

this object
fragment
(String
the new fragment value
fragment
)

Set the fragment specifier for the link.

public Content

Returns:

the label for this class link.
getClassLinkLabel
(BaseConfiguration
the current configuration of the doclet.
configuration
)

Return the label for this class link.

public HtmlLinkInfo.Kind

Returns:

the link context
getContext
()

Returns the link context.

public ExecutableElement
getExecutableElement()

The executable element we want to link to.

public String

Returns:

the fragment of the link
getFragment
()

Returns the fragment of the link.

public Content

Returns:

the label for the link
getLabel
()

Returns the label for the link.

public HtmlStyle

Returns:

the optional style for the link
getStyle
()

Returns the optional style for the link.

public Element

Returns:

the member this link points to (if any)
getTargetMember
()

Returns the member this link points to (if any).

public String

Returns:

the value of the title attribute
getTitle
()

Returns the value of the title attribute.

public TypeMirror
getType()

The Type we want to link to.

public TypeElement
getTypeElement()

The class we want to link to.

public boolean

Returns:

true if this link is linkable and false if we can't link to the desired place.
isLinkable
()

Return true if this link is linkable and false if we can't link to the desired place.

public boolean

Returns:

true iff the preview flags should be skipped for this link
isSkipPreview
()

Returns true iff the preview flags should be skipped for this link.

public boolean

Returns:

true if this is a link to a vararg member
isVarArg
()

Returns true if this is a link to a vararg member.

public HtmlLinkInfo

Returns:

this object
label
(CharSequence
plain-text label for the link
label
)

Set the label for the link.

public HtmlLinkInfo

Returns:

this object
label
(Content
the new value
label
)

Set the label for the link.

public HtmlLinkInfo

Returns:

this object
linkToSelf
(boolean
the new value
linkToSelf
)

Set the linkToSelf flag for this link.

public boolean

Returns:

true if we should generate links to the current page
linkToSelf
()

Returns true if we should generate links to the current page.

public boolean

Returns:

true if type parameters should be rendered as links
linkTypeParameters
()

Returns true if type parameters should be rendered as links.

protected Content

Returns:

a new instance of a content object
newContent
()

Returns a new instance of a content object.

private void
setContext(HtmlLinkInfo.Kind
the context id to set.
c
)

This method sets the link attributes to the appropriate values based on the context.

public void
setTypeElement(TypeElement
the new typeElement object
typeElement
)

Sets the typeElement

public void
showTypeBounds(boolean
the new value
showTypeBounds
)

Set the showTypeBounds flag for this link

public boolean

Returns:

true if we should print the type bounds for the type parameter
showTypeBounds
()

Returns true if we should print the type bounds for the type parameter.

public HtmlLinkInfo

Returns:

this object
showTypeParameterAnnotations
(boolean
the new value
showTypeParameterAnnotations
)

Set the showTypeParameterAnnotations flag for this link.

public boolean

Returns:

true if annotations on type parameters should be shown
showTypeParameterAnnotations
()

Returns true if annotations on type parameters should be shown.

public boolean

Returns:

true if type parameter links should be included
showTypeParameters
()

Returns true if links to declared types should include type parameters.

public HtmlLinkInfo

Returns:

this object
skipPreview
(boolean
the new value
skipPreview
)

Set whether or not the preview flags should be skipped for this link.

public HtmlLinkInfo

Returns:

this object
style
(HtmlStyle
the new style value
style
)

Sets the style to be used for the link.

public HtmlLinkInfo

Returns:

this object
targetMember
(Element
the new member value
el
)

Set the member this link points to (if any).

public HtmlLinkInfo

Returns:

this object
title
(String
the value of the title attribute
title
)

Sets the title attribute for the link.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public HtmlLinkInfo

Returns:

this object
varargs
(boolean
the new value
varargs
)

Set whether or not this is a link to a varargs parameter.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

addLineBreakOpportunitiesInTypeParametersback to summary
private boolean addLineBreakOpportunitiesInTypeParameters
configurationback to summary
private final HtmlConfiguration configuration
contextback to summary
private HtmlLinkInfo.Kind context
executableElementback to summary
private ExecutableElement executableElement
fragmentback to summary
private String fragment
isVarArgback to summary
private boolean isVarArg
labelback to summary
private Content label
linkToSelfback to summary
private boolean linkToSelf
linkTypeParametersback to summary
private boolean linkTypeParameters
showTypeBoundsback to summary
private boolean showTypeBounds
showTypeParameterAnnotationsback to summary
private boolean showTypeParameterAnnotations
skipPreviewback to summary
private boolean skipPreview
styleback to summary
private HtmlStyle style
targetMemberback to summary
private Element targetMember
titleback to summary
private String title
typeback to summary
private TypeMirror type
typeElementback to summary
private TypeElement typeElement

Constructor Detail

HtmlLinkInfoback to summary
public HtmlLinkInfo(HtmlConfiguration configuration, HtmlLinkInfo.Kind context, ExecutableElement ee)

Construct a LinkInfo object.

Parameters
configuration:HtmlConfiguration

the configuration data for the doclet

context:HtmlLinkInfo.Kind

the context of the link.

ee:ExecutableElement

the member to link to.

HtmlLinkInfoback to summary
public HtmlLinkInfo(HtmlConfiguration configuration, HtmlLinkInfo.Kind context, TypeElement typeElement)

Construct a LinkInfo object.

Parameters
configuration:HtmlConfiguration

the configuration data for the doclet

context:HtmlLinkInfo.Kind

the context of the link.

typeElement:TypeElement

the class to link to.

HtmlLinkInfoback to summary
public HtmlLinkInfo(HtmlConfiguration configuration, HtmlLinkInfo.Kind context, TypeMirror type)

Construct a LinkInfo object.

Parameters
configuration:HtmlConfiguration

the configuration data for the doclet

context:HtmlLinkInfo.Kind

the context of the link.

type:TypeMirror

the class to link to.

Method Detail

addLineBreakOpportunitiesInTypeParametersback to summary
public HtmlLinkInfo addLineBreakOpportunitiesInTypeParameters(boolean addLineBreakOpportunities)

Sets the addLineBreakOpportunitiesInTypeParameters flag for this link.

Parameters
addLineBreakOpportunities:boolean

the new value

Returns:HtmlLinkInfo

this object

addLineBreakOpportunitiesInTypeParametersback to summary
public boolean addLineBreakOpportunitiesInTypeParameters()

Returns true if line break opportunities should be added to type parameters.

Returns:boolean

true if line break opportunities should be added to type parameters

forTypeback to summary
public HtmlLinkInfo forType(TypeMirror type)

Creates a copy of this HtmlLinkInfo instance with a different TypeMirror. This is used for contained types such as type parameters or array components.

Parameters
type:TypeMirror

the type mirror

Returns:HtmlLinkInfo

the new link info

fragmentback to summary
public HtmlLinkInfo fragment(String fragment)

Set the fragment specifier for the link.

Parameters
fragment:String

the new fragment value

Returns:HtmlLinkInfo

this object

getClassLinkLabelback to summary
public Content getClassLinkLabel(BaseConfiguration configuration)

Return the label for this class link.

Parameters
configuration:BaseConfiguration

the current configuration of the doclet.

Returns:Content

the label for this class link.

getContextback to summary
public HtmlLinkInfo.Kind getContext()

Returns the link context.

Returns:HtmlLinkInfo.Kind

the link context

getExecutableElementback to summary
public ExecutableElement getExecutableElement()

The executable element we want to link to. Null if we are not linking to an executable element.

getFragmentback to summary
public String getFragment()

Returns the fragment of the link.

Returns:String

the fragment of the link

getLabelback to summary
public Content getLabel()

Returns the label for the link.

Returns:Content

the label for the link

getStyleback to summary
public HtmlStyle getStyle()

Returns the optional style for the link.

Returns:HtmlStyle

the optional style for the link

getTargetMemberback to summary
public Element getTargetMember()

Returns the member this link points to (if any).

Returns:Element

the member this link points to (if any)

getTitleback to summary
public String getTitle()

Returns the value of the title attribute.

Returns:String

the value of the title attribute

getTypeback to summary
public TypeMirror getType()

The Type we want to link to. Null if we are not linking to a type.

getTypeElementback to summary
public TypeElement getTypeElement()

The class we want to link to. Null if we are not linking to a class.

isLinkableback to summary
public boolean isLinkable()

Return true if this link is linkable and false if we can't link to the desired place.

Returns:boolean

true if this link is linkable and false if we can't link to the desired place.

isSkipPreviewback to summary
public boolean isSkipPreview()

Returns true iff the preview flags should be skipped for this link.

Returns:boolean

true iff the preview flags should be skipped for this link

isVarArgback to summary
public boolean isVarArg()

Returns true if this is a link to a vararg member.

Returns:boolean

true if this is a link to a vararg member

labelback to summary
public HtmlLinkInfo label(CharSequence label)

Set the label for the link.

Parameters
label:CharSequence

plain-text label for the link

Returns:HtmlLinkInfo

this object

labelback to summary
public HtmlLinkInfo label(Content label)

Set the label for the link.

Parameters
label:Content

the new value

Returns:HtmlLinkInfo

this object

linkToSelfback to summary
public HtmlLinkInfo linkToSelf(boolean linkToSelf)

Set the linkToSelf flag for this link.

Parameters
linkToSelf:boolean

the new value

Returns:HtmlLinkInfo

this object

linkToSelfback to summary
public boolean linkToSelf()

Returns true if we should generate links to the current page.

Returns:boolean

true if we should generate links to the current page

linkTypeParametersback to summary
public boolean linkTypeParameters()

Returns true if type parameters should be rendered as links.

Returns:boolean

true if type parameters should be rendered as links

newContentback to summary
protected Content newContent()

Returns a new instance of a content object.

Returns:Content

a new instance of a content object

setContextback to summary
private void setContext(HtmlLinkInfo.Kind c)

This method sets the link attributes to the appropriate values based on the context.

Parameters
c:HtmlLinkInfo.Kind

the context id to set.

setTypeElementback to summary
public void setTypeElement(TypeElement typeElement)

Sets the typeElement

Parameters
typeElement:TypeElement

the new typeElement object

showTypeBoundsback to summary
public void showTypeBounds(boolean showTypeBounds)

Set the showTypeBounds flag for this link

Parameters
showTypeBounds:boolean

the new value

showTypeBoundsback to summary
public boolean showTypeBounds()

Returns true if we should print the type bounds for the type parameter.

Returns:boolean

true if we should print the type bounds for the type parameter

showTypeParameterAnnotationsback to summary
public HtmlLinkInfo showTypeParameterAnnotations(boolean showTypeParameterAnnotations)

Set the showTypeParameterAnnotations flag for this link.

Parameters
showTypeParameterAnnotations:boolean

the new value

Returns:HtmlLinkInfo

this object

showTypeParameterAnnotationsback to summary
public boolean showTypeParameterAnnotations()

Returns true if annotations on type parameters should be shown.

Returns:boolean

true if annotations on type parameters should be shown

showTypeParametersback to summary
public boolean showTypeParameters()

Returns true if links to declared types should include type parameters.

Returns:boolean

true if type parameter links should be included

skipPreviewback to summary
public HtmlLinkInfo skipPreview(boolean skipPreview)

Set whether or not the preview flags should be skipped for this link.

Parameters
skipPreview:boolean

the new value

Returns:HtmlLinkInfo

this object

styleback to summary
public HtmlLinkInfo style(HtmlStyle style)

Sets the style to be used for the link.

Parameters
style:HtmlStyle

the new style value

Returns:HtmlLinkInfo

this object

targetMemberback to summary
public HtmlLinkInfo targetMember(Element el)

Set the member this link points to (if any).

Parameters
el:Element

the new member value

Returns:HtmlLinkInfo

this object

titleback to summary
public HtmlLinkInfo title(String title)

Sets the title attribute for the link.

Parameters
title:String

the value of the title attribute

Returns:HtmlLinkInfo

this object

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
varargsback to summary
public HtmlLinkInfo varargs(boolean varargs)

Set whether or not this is a link to a varargs parameter.

Parameters
varargs:boolean

the new value

Returns:HtmlLinkInfo

this object

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

public final Enum HtmlLinkInfo.Kind

extends Enum<HtmlLinkInfo.Kind>
Class Inheritance

Enumeration of different kinds of links.

Field Summary

Modifier and TypeField and Description
public static final HtmlLinkInfo.Kind
PLAIN

Link with just the element name as label.

public static final HtmlLinkInfo.Kind
SHOW_PREVIEW

Link with additional preview flag if appropriate.

public static final HtmlLinkInfo.Kind
SHOW_TYPE_PARAMS

Link with optional type parameters appended as plain text.

public static final HtmlLinkInfo.Kind
SHOW_TYPE_PARAMS_AND_BOUNDS

Link with optional type parameters and bounds appended as plain text.

public static final HtmlLinkInfo.Kind
SHOW_TYPE_PARAMS_IN_LABEL

Link with optional type parameters included in the link label.

Constructor Summary

AccessConstructor and Description
private
Kind()

Method Summary

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

Field Detail

PLAINback to summary
public static final HtmlLinkInfo.Kind PLAIN

Link with just the element name as label.

SHOW_PREVIEWback to summary
public static final HtmlLinkInfo.Kind SHOW_PREVIEW

Link with additional preview flag if appropriate.

SHOW_TYPE_PARAMSback to summary
public static final HtmlLinkInfo.Kind SHOW_TYPE_PARAMS

Link with optional type parameters appended as plain text.

SHOW_TYPE_PARAMS_AND_BOUNDSback to summary
public static final HtmlLinkInfo.Kind SHOW_TYPE_PARAMS_AND_BOUNDS

Link with optional type parameters and bounds appended as plain text.

SHOW_TYPE_PARAMS_IN_LABELback to summary
public static final HtmlLinkInfo.Kind SHOW_TYPE_PARAMS_IN_LABEL

Link with optional type parameters included in the link label.

Constructor Detail

Kindback to summary
private Kind()

Method Detail

valueOfback to summary
public static HtmlLinkInfo.Kind valueOf(String name)
valuesback to summary
public static HtmlLinkInfo.Kind[] values()