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

public abstract Class AbstractMemberWriter

extends Object
Class Inheritance
Known Direct Subclasses
jdk.javadoc.internal.doclets.formats.html.AnnotationTypeMemberWriter, jdk.javadoc.internal.doclets.formats.html.EnumConstantWriter, jdk.javadoc.internal.doclets.formats.html.FieldWriter, jdk.javadoc.internal.doclets.formats.html.NestedClassWriter, jdk.javadoc.internal.doclets.formats.html.PropertyWriter, jdk.javadoc.internal.doclets.formats.html.AbstractExecutableMemberWriter
Imports
java.util.ArrayList, .Collection, .Comparator, .LinkedHashMap, .List, .Map, .Objects, .Optional, .Set, .SortedSet, .TreeSet, javax.lang.model.element.Element, .ElementKind, .ExecutableElement, .TypeElement, .TypeParameterElement, javax.lang.model.type.TypeMirror, com.sun.source.doctree.DocTree, jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyles, jdk.javadoc.internal.doclets.toolkit.PropertyUtils, .Resources, jdk.javadoc.internal.doclets.toolkit.util.DocFinder, .Utils, .VisibleMemberTable, jdk.javadoc.internal.html.Content, .ContentBuilder, .Entity, .HtmlId, .HtmlTree, .Text

The base class for member writers. Two primary methods are defined: buildSummary(Content) and buildDetails(Content).

Field Summary

Modifier and TypeField and Description
protected final HtmlConfiguration
protected final Contents
pack-priv static final List<VisibleMemberTable.Kind>
detailKinds

The list of kinds of detail lists that appear in the page for any type element.

protected final HtmlIds
protected final VisibleMemberTable.Kind
protected final HtmlOptions
protected final Resources
protected final Comparator<Element>
pack-priv static final List<VisibleMemberTable.Kind>
summaryKinds

The list of kinds of summary table that appear in the page for any type element.

private Table<Element>
protected final TypeElement
protected final Utils
protected final VisibleMemberTable
protected final SubWriterHolderWriter

Constructor Summary

AccessConstructor and Description
protected
AbstractMemberWriter(ClassWriter
the enclosing "page" writer.
writer
,
VisibleMemberTable.Kind
the kind
kind
)

Creates a member writer for a given enclosing writer and kind of member.

protected
AbstractMemberWriter(SubWriterHolderWriter
the writer
writer
)

Creates a member writer for a given enclosing writer.

protected
AbstractMemberWriter(SubWriterHolderWriter
the writer
writer
,
TypeElement typeElement, VisibleMemberTable.Kind kind)

Creates a member writer for a given enclosing writer, and optional type element and member kind.

Method Summary

Modifier and TypeMethod and Description
protected void
addComment(Element
the member being documented.
member
,
Content
the content to which the comment will be added.
content
)

Adds the comment for the given member.

protected void
addDeprecatedInfo(Element
the member being documented.
member
,
Content
the content to which the deprecated information will be added.
target
)

Adds the deprecated information for the given member.

public void
addInheritedMemberSummary(TypeElement
the class the inherited member belongs to
tElement
,
Element
the inherited member that is being documented
member
,
boolean
true if this is the first member in the list
isFirst
,
Content
the content to which the links will be added
content
)

Adds the inherited member summary for the given class and member.

public void
addInheritedSummaryLabel(TypeElement
the type element to which to link to
typeElement
,
Content
the content to which the inherited summary label will be added
content
)

Adds inherited summary label for the member.

public void
addMemberSummary(TypeElement
the class the summary belongs to
tElement
,
Element
the member that is documented
member
,
List<? extends DocTree>
the tags for the sentence being documented
firstSentenceTrees
,
Table<Element> table)

Adds the member summary for the given class and member.

private void
addMemberSummaryTableRow(TypeElement
the enclosing type of the member
enclosingType
,
Element
the member
member
,
Table<Element>
the summary table
table
,
PropertyUtils.PropertyHelper
property helper to patch doctree
propertyHelper
)

Adds the summary table row for a member.

private void
addModifiers(Element
the member to add the modifiers for
member
,
Content
the content to which the modifiers will be added
target
)

Adds the modifiers for the member.

protected void
addModifiersAndType(Element
the member to add the modifiers and type for
member
,
TypeMirror
the type to add
type
,
Content
the content to which the modifiers and type will be added
target
)

Adds the modifiers and type for the member in the member summary.

protected void
addPreviewInfo(Element
the member being documented.
member
,
Content
the content to which the preview information will be added.
content
)

Add the preview information for the given member.

protected void
addRestrictedInfo(ExecutableElement
the method being documented.
method
,
Content
the content to which the preview information will be added.
content
)

Add the restricted information for the given method.

private void
addSummaryFootNote(TypeElement inheritedClass, Iterable<Element> inheritedMembers, Content links)

public abstract void
addSummaryLabel(Content
the content to which the label will be added
content
)

Adds the summary label for the member.

protected abstract void
addSummaryType(Element
the member to be documented
member
,
Content
the content to which the type will be added
content
)

Adds the summary type for the member.

protected void
addUseInfo(List<? extends Element>
list of program elements for which the use information will be added
members
,
Content
the section heading
heading
,
Content
the content to which the use information will be added
content
)

Adds use information to the documentation.

private SortedSet<? extends Element>
asSortedSet(Collection<? extends Element> members)

protected abstract void
buildDeprecationInfo(Content
the content to which the documentation will be added
target
)

Builds the deprecation info.

public abstract void
buildDetails(Content
the content to which the list will be added
target
)

Builds the list of "details" for all members of this kind.

private int

Returns:

the number of added summary lists, excluding methods from java.lang.Object
buildInheritedSummary
(List<Content>
the list of contents to which the documentation will be added
targets
,
Map<HtmlId, Content>
map of TOC entries for added summaries
tocEntries
)

Builds the inherited member summary for the members of this kind.

private int

Returns:

the number of documented members
buildMainSummary
(List<Content>
the list of contents to which the documentation will be added
summaryTreeList
)

Builds the main summary table for the members of this kind.

protected abstract void
buildPreviewInfo(Content
the content to which the documentation will be added
target
)

Builds the preview info.

protected abstract void
buildSignature(Content
the content to which the documentation will be added
target
)

Builds the signature.

public void
buildSummary(Content
the content to which the list will be added
target
)

Builds the "summary" for all members of this kind.

public abstract void
buildSummary(Content
the list of summaries
summariesList
,
Content
the summary
content
)

Adds the given summary to the list of summaries.

protected Table<Element>

Returns:

a summary table
createInheritedSummaryTable
(TypeElement
the superclass or interface
typeElement
)

Creates a summary table for members of the kind supported by this writer inherited from typeElement.

protected abstract Table<Element>

Returns:

the summary table
createSummaryTable
()

Creates the summary table for this element.

public Content

Returns:

the inherited member summary header
getInheritedSummaryHeader
(TypeElement
the class the summary belongs to
tElement
)

Returns the inherited member summary header for the given class.

protected HtmlId

Returns:

the id for the summary table
getInheritedSummaryId
(TypeElement
the superclass or interface
typeElement
)

Creates an id for a summary table for members of the kind supported by this writer inherited from typeElement.

public Content

Returns:

the member content
getMember
(Content
the content representing the member
memberContent
)

Returns the member content.

protected Content

Returns:

a list to add member items to
getMemberList
()

Returns a list to add member items to.

protected Content

Returns:

a member item
getMemberListItem
(Content
the member to represent as an item
memberContent
)

Returns a member item.

public abstract Content

Returns:

the member summary header
getMemberSummaryHeader
(Content
the content to which the member summary will be added
content
)

Returns the member summary header for the given class.

protected Content

Returns:

a link to the member summary section of class or interface element indicated by summaryKind with the simple type name as link label, or the fully qualified type name if the class or interface is not linkable
getMemberSummaryLinkOrFQN
(TypeElement element, VisibleMemberTable.Kind summaryKind)

Returns a link to the member summary section of class or interface element indicated by summaryKind with the simple type name as link label, or the fully qualified type name if the class or interface is not linkable.

private Content
private Table<Element>
public Content

Returns:

the summary table
getSummaryTable
(TypeElement
the class the summary table belongs to
tElement
)

Returns the summary table for the given class.

public abstract TableHeader

Returns:

the summary table header
getSummaryTableHeader
(Element
the member to be documented
member
)

Returns the summary table header for the member.

protected List<Element>

Returns:

a list of members
getVisibleMembers
(VisibleMemberTable.Kind
of members
kind
)

Returns a list of visible elements of the specified kind in this type element.

protected String
name(Element member)

protected void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

configurationback to summary
protected final HtmlConfiguration configuration
contentsback to summary
protected final Contents contents
detailKindsback to summary
pack-priv static final List<VisibleMemberTable.Kind> detailKinds

The list of kinds of detail lists that appear in the page for any type element.

Note

this is not the default ordering of VisibleMemberTable.Kind. For what it is worth, that ordering is relied on by Navigation. Compared to summaryKinds, this list does not include nested classes and just a single kind for all annotation type members, although nested classes could be included by ensuring that buildDetails is a no-op.

See Also
VisibleMemberTable.Kind#forDetailsOf(ElementKind)
htmlIdsback to summary
protected final HtmlIds htmlIds
kindback to summary
protected final VisibleMemberTable.Kind kind
optionsback to summary
protected final HtmlOptions options
resourcesback to summary
protected final Resources resources
summariesComparatorback to summary
protected final Comparator<Element> summariesComparator
summaryKindsback to summary
pack-priv static final List<VisibleMemberTable.Kind> summaryKinds

The list of kinds of summary table that appear in the page for any type element.

Note

this is not the default ordering of VisibleMemberTable.Kind. For what it is worth, that ordering is relied on by Navigation. Compared to detailKinds, this list includes nested classes and distinct kinds for required and optional annotation type members

See Also
VisibleMemberTable.Kind#forSummariesOf(ElementKind)
summaryTableback to summary
private Table<Element> summaryTable
typeElementback to summary
protected final TypeElement typeElement
utilsback to summary
protected final Utils utils
visibleMemberTableback to summary
protected final VisibleMemberTable visibleMemberTable
writerback to summary
protected final SubWriterHolderWriter writer

Constructor Detail

AbstractMemberWriterback to summary
protected AbstractMemberWriter(ClassWriter writer, VisibleMemberTable.Kind kind)

Creates a member writer for a given enclosing writer and kind of member.

Parameters
writer:ClassWriter

the enclosing "page" writer.

kind:VisibleMemberTable.Kind

the kind

AbstractMemberWriterback to summary
protected AbstractMemberWriter(SubWriterHolderWriter writer)

Creates a member writer for a given enclosing writer. No type element or kind is provided, limiting the set of methods that can be used.

Parameters
writer:SubWriterHolderWriter

the writer

AbstractMemberWriterback to summary
protected AbstractMemberWriter(SubWriterHolderWriter writer, TypeElement typeElement, VisibleMemberTable.Kind kind)

Creates a member writer for a given enclosing writer, and optional type element and member kind. If no specific type element or kind is provided, methods that require such information may throw NullPointerException.

Parameters
writer:SubWriterHolderWriter

the writer

Method Detail

addCommentback to summary
protected void addComment(Element member, Content content)

Adds the comment for the given member.

Parameters
member:Element

the member being documented.

content:Content

the content to which the comment will be added.

addDeprecatedInfoback to summary
protected void addDeprecatedInfo(Element member, Content target)

Adds the deprecated information for the given member.

Parameters
member:Element

the member being documented.

target:Content

the content to which the deprecated information will be added.

addInheritedMemberSummaryback to summary
public void addInheritedMemberSummary(TypeElement tElement, Element member, boolean isFirst, Content content)

Adds the inherited member summary for the given class and member.

Parameters
tElement:TypeElement

the class the inherited member belongs to

member:Element

the inherited member that is being documented

isFirst:boolean

true if this is the first member in the list

content:Content

the content to which the links will be added

addInheritedSummaryLabelback to summary
public void addInheritedSummaryLabel(TypeElement typeElement, Content content)

Adds inherited summary label for the member.

Parameters
typeElement:TypeElement

the type element to which to link to

content:Content

the content to which the inherited summary label will be added

addMemberSummaryback to summary
public void addMemberSummary(TypeElement tElement, Element member, List<? extends DocTree> firstSentenceTrees, Table<Element> table)

Adds the member summary for the given class and member.

Parameters
tElement:TypeElement

the class the summary belongs to

member:Element

the member that is documented

firstSentenceTrees:List<? extends DocTree>

the tags for the sentence being documented

addMemberSummaryTableRowback to summary
private void addMemberSummaryTableRow(TypeElement enclosingType, Element member, Table<Element> table, PropertyUtils.PropertyHelper propertyHelper)

Adds the summary table row for a member.

Parameters
enclosingType:TypeElement

the enclosing type of the member

member:Element

the member

table:Table<Element>

the summary table

propertyHelper:PropertyUtils.PropertyHelper

property helper to patch doctree

addModifiersback to summary
private void addModifiers(Element member, Content target)

Adds the modifiers for the member.

Parameters
member:Element

the member to add the modifiers for

target:Content

the content to which the modifiers will be added

addModifiersAndTypeback to summary
protected void addModifiersAndType(Element member, TypeMirror type, Content target)

Adds the modifiers and type for the member in the member summary.

Parameters
member:Element

the member to add the modifiers and type for

type:TypeMirror

the type to add

target:Content

the content to which the modifiers and type will be added

addPreviewInfoback to summary
protected void addPreviewInfo(Element member, Content content)

Add the preview information for the given member.

Parameters
member:Element

the member being documented.

content:Content

the content to which the preview information will be added.

addRestrictedInfoback to summary
protected void addRestrictedInfo(ExecutableElement method, Content content)

Add the restricted information for the given method.

Parameters
method:ExecutableElement

the method being documented.

content:Content

the content to which the preview information will be added.

addSummaryFootNoteback to summary
private void addSummaryFootNote(TypeElement inheritedClass, Iterable<Element> inheritedMembers, Content links)
addSummaryLabelback to summary
public abstract void addSummaryLabel(Content content)

Adds the summary label for the member.

Parameters
content:Content

the content to which the label will be added

addSummaryTypeback to summary
protected abstract void addSummaryType(Element member, Content content)

Adds the summary type for the member.

Parameters
member:Element

the member to be documented

content:Content

the content to which the type will be added

addUseInfoback to summary
protected void addUseInfo(List<? extends Element> members, Content heading, Content content)

Adds use information to the documentation.

Parameters
members:List<? extends Element>

list of program elements for which the use information will be added

heading:Content

the section heading

content:Content

the content to which the use information will be added

asSortedSetback to summary
private SortedSet<? extends Element> asSortedSet(Collection<? extends Element> members)
buildDeprecationInfoback to summary
protected abstract void buildDeprecationInfo(Content target)

Builds the deprecation info.

Parameters
target:Content

the content to which the documentation will be added

buildDetailsback to summary
public abstract void buildDetails(Content target)

Builds the list of "details" for all members of this kind.

Parameters
target:Content

the content to which the list will be added

buildInheritedSummaryback to summary
private int buildInheritedSummary(List<Content> targets, Map<HtmlId, Content> tocEntries)

Builds the inherited member summary for the members of this kind.

Parameters
targets:List<Content>

the list of contents to which the documentation will be added

tocEntries:Map<HtmlId, Content>

map of TOC entries for added summaries

Returns:int

the number of added summary lists, excluding methods from java.lang.Object

buildMainSummaryback to summary
private int buildMainSummary(List<Content> summaryTreeList)

Builds the main summary table for the members of this kind.

Parameters
summaryTreeList:List<Content>

the list of contents to which the documentation will be added

Returns:int

the number of documented members

buildPreviewInfoback to summary
protected abstract void buildPreviewInfo(Content target)

Builds the preview info.

Parameters
target:Content

the content to which the documentation will be added

buildSignatureback to summary
protected abstract void buildSignature(Content target)

Builds the signature.

Parameters
target:Content

the content to which the documentation will be added

buildSummaryback to summary
public void buildSummary(Content target)

Builds the "summary" for all members of this kind.

Parameters
target:Content

the content to which the list will be added

buildSummaryback to summary
public abstract void buildSummary(Content summariesList, Content content)

Adds the given summary to the list of summaries.

Parameters
summariesList:Content

the list of summaries

content:Content

the summary

createInheritedSummaryTableback to summary
protected Table<Element> createInheritedSummaryTable(TypeElement typeElement)

Creates a summary table for members of the kind supported by this writer inherited from typeElement.

Parameters
typeElement:TypeElement

the superclass or interface

Returns:Table<Element>

a summary table

createSummaryTableback to summary
protected abstract Table<Element> createSummaryTable()

Creates the summary table for this element. The table should be created and initialized if needed, and configured so that it is ready to add content with Table#addRow(Content[]) and similar methods.

Returns:Table<Element>

the summary table

getInheritedSummaryHeaderback to summary
public Content getInheritedSummaryHeader(TypeElement tElement)

Returns the inherited member summary header for the given class.

Parameters
tElement:TypeElement

the class the summary belongs to

Returns:Content

the inherited member summary header

getInheritedSummaryIdback to summary
protected HtmlId getInheritedSummaryId(TypeElement typeElement)

Creates an id for a summary table for members of the kind supported by this writer inherited from typeElement.

Parameters
typeElement:TypeElement

the superclass or interface

Returns:HtmlId

the id for the summary table

getMemberback to summary
public Content getMember(Content memberContent)

Returns the member content.

Parameters
memberContent:Content

the content representing the member

Returns:Content

the member content

getMemberListback to summary
protected Content getMemberList()

Returns a list to add member items to.

Returns:Content

a list to add member items to

See Also
getMemberListItem(Content)
getMemberListItemback to summary
protected Content getMemberListItem(Content memberContent)

Returns a member item.

Parameters
memberContent:Content

the member to represent as an item

Returns:Content

a member item

See Also
getMemberList()
getMemberSummaryHeaderback to summary
public abstract Content getMemberSummaryHeader(Content content)

Returns the member summary header for the given class.

Parameters
content:Content

the content to which the member summary will be added

Returns:Content

the member summary header

getMemberSummaryLinkOrFQNback to summary
protected Content getMemberSummaryLinkOrFQN(TypeElement element, VisibleMemberTable.Kind summaryKind)

Returns a link to the member summary section of class or interface element indicated by summaryKind with the simple type name as link label, or the fully qualified type name if the class or interface is not linkable.

Returns:Content

a link to the member summary section of class or interface element indicated by summaryKind with the simple type name as link label, or the fully qualified type name if the class or interface is not linkable

getSummaryLabelback to summary
private Content getSummaryLabel()
getSummaryTableback to summary
private Table<Element> getSummaryTable()
getSummaryTableback to summary
public Content getSummaryTable(TypeElement tElement)

Returns the summary table for the given class.

Parameters
tElement:TypeElement

the class the summary table belongs to

Returns:Content

the summary table

getSummaryTableHeaderback to summary
public abstract TableHeader getSummaryTableHeader(Element member)

Returns the summary table header for the member.

Parameters
member:Element

the member to be documented

Returns:TableHeader

the summary table header

getVisibleMembersback to summary
protected List<Element> getVisibleMembers(VisibleMemberTable.Kind kind)

Returns a list of visible elements of the specified kind in this type element.

Parameters
kind:VisibleMemberTable.Kind

of members

Returns:List<Element>

a list of members

nameback to summary
protected String name(Element member)
serialWarningback to summary
protected void serialWarning(Element e, String key, String a1, String a2)