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

public Class SimpleTaglet

extends BaseTaglet
implements InheritableTaglet
Class Inheritance
All Implemented Interfaces
jdk.javadoc.internal.doclets.formats.html.taglets.InheritableTaglet
Imports
java.util.EnumSet, .List, .Optional, .Set, java.util.function.Predicate, javax.lang.model.element.Element, .ElementKind, .ExecutableElement, .NestingKind, .TypeElement, com.sun.source.doctree.BlockTagTree, .DocTree, jdk.javadoc.doclet.Taglet, jdk.javadoc.internal.doclets.formats.html.HtmlConfiguration, jdk.javadoc.internal.doclets.toolkit.util.DocFinder, jdk.javadoc.internal.html.Content, .ContentBuilder, .HtmlTree, .RawHtml

A custom single-argument block tag.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static record

Field Summary

Modifier and TypeField and Description
private final boolean
private final String
header

The header to output.

Inherited from jdk.javadoc.internal.doclets.formats.html.taglets.BaseTaglet:
configmessagesnameresourcestagKindtagletWriterutils

Constructor Summary

AccessConstructor and Description
pack-priv
SimpleTaglet(HtmlConfiguration config, String
the name of this tag
tagName
,
String
the header to output
header
,
String
the possible locations that this tag can appear in The string can contain 'p' for package, 't' for type, 'm' for method, 'c' for constructor and 'f' for field. See getLocations for the complete list.
locations
)

Constructs a SimpleTaglet.

pack-priv
SimpleTaglet(HtmlConfiguration config, DocTree.Kind
the kind of this tag
tagKind
,
String
the header to output
header
,
Set<Taglet.Location>
the possible locations that this tag can appear in
locations
)

Constructs a SimpleTaglet.

pack-priv
SimpleTaglet(HtmlConfiguration config, String
the name of this tag
tagName
,
String
the header to output
header
,
Set<Taglet.Location>
the possible locations that this tag can appear in
locations
)

Constructs a SimpleTaglet.

private
SimpleTaglet(HtmlConfiguration config, String
the name of this tag
tagName
,
String
the header to output
header
,
Set<Taglet.Location>
the possible locations that this tag can appear in
locations
,
boolean
whether this tag is enabled
enabled
)

Constructs a SimpleTaglet.

protected
SimpleTaglet(HtmlConfiguration config, DocTree.Kind
the kind of this tag
tagKind
,
String
the header to output
header
,
Set<Taglet.Location>
the possible locations that this tag can appear in
locations
,
boolean
whether this tag is enabled
enabled
)

Constructs a SimpleTaglet.

Method Summary

Modifier and TypeMethod and Description
private boolean

Returns:

true if this taglet accepts this tree node
accepts
(BlockTagTree
the tree node
tree
)

Returns whether this taglet accepts a BlockTagTree node.

pack-priv static SimpleTaglet
createWithDefaultForNested(HtmlConfiguration config, DocTree.Kind
the kind of this tag
tagKind
,
String
the header to output
header
,
Set<Taglet.Location>
the possible locations that this tag can appear in
locations
,
boolean
whether this tag is enabled
enabled
)

Constructs a SimpleTaglet that will look for tags on enclosing type elements if there are no relevant tags on a nested (member) type element.

private Optional<SimpleTaglet.Documentation>
public Content
getAllBlockTagOutput(Element holder, TagletWriter tagletWriter)

Overrides jdk.javadoc.internal.doclets.formats.html.taglets.BaseTaglet.getAllBlockTagOutput.

Implements jdk.javadoc.internal.doclets.formats.html.taglets.Taglet.getAllBlockTagOutput.

Returns the content to be included in the generated output for all instances of block tags handled by this taglet.

private List<? extends BlockTagTree>
protected List<? extends BlockTagTree>
private static Set<Taglet.Location>
getLocations(String locations)

public InheritableTaglet.Output
pack-priv boolean
isEnabled()

Whether the taglet should generate output.

private static boolean
isEnabled(String locations)

private Content

Returns:

the output
simpleBlockTagOutput
(Element
The element that owns the doc comment
element
,
List<? extends DocTree>
the list of simple tags
simpleTags
,
String
the header for the series of tags
header
)

Returns the output for a series of simple tags.

Inherited from jdk.javadoc.internal.doclets.formats.html.taglets.BaseTaglet:
getAllowedLocationsgetInlineTagOutputgetNamegetTagKindisInlineTag

Field Detail

enabledback to summary
private final boolean enabled

Constructor Detail

SimpleTagletback to summary
pack-priv SimpleTaglet(HtmlConfiguration config, String tagName, String header, String locations)

Constructs a SimpleTaglet.

Parameters
tagName:String

the name of this tag

header:String

the header to output

locations:String

the possible locations that this tag can appear in The string can contain 'p' for package, 't' for type, 'm' for method, 'c' for constructor and 'f' for field. See getLocations for the complete list.

SimpleTagletback to summary
pack-priv SimpleTaglet(HtmlConfiguration config, DocTree.Kind tagKind, String header, Set<Taglet.Location> locations)

Constructs a SimpleTaglet.

Parameters
tagKind:DocTree.Kind

the kind of this tag

header:String

the header to output

locations:Set<Taglet.Location>

the possible locations that this tag can appear in

SimpleTagletback to summary
pack-priv SimpleTaglet(HtmlConfiguration config, String tagName, String header, Set<Taglet.Location> locations)

Constructs a SimpleTaglet.

Parameters
tagName:String

the name of this tag

header:String

the header to output

locations:Set<Taglet.Location>

the possible locations that this tag can appear in

SimpleTagletback to summary
private SimpleTaglet(HtmlConfiguration config, String tagName, String header, Set<Taglet.Location> locations, boolean enabled)

Constructs a SimpleTaglet.

Parameters
tagName:String

the name of this tag

header:String

the header to output

locations:Set<Taglet.Location>

the possible locations that this tag can appear in

enabled:boolean

whether this tag is enabled

SimpleTagletback to summary
protected SimpleTaglet(HtmlConfiguration config, DocTree.Kind tagKind, String header, Set<Taglet.Location> locations, boolean enabled)

Constructs a SimpleTaglet.

Parameters
tagKind:DocTree.Kind

the kind of this tag

header:String

the header to output

locations:Set<Taglet.Location>

the possible locations that this tag can appear in

enabled:boolean

whether this tag is enabled

Method Detail

acceptsback to summary
private boolean accepts(BlockTagTree tree)

Returns whether this taglet accepts a BlockTagTree node. The taglet accepts a tree node if it has the same kind, or if the kind is UNKNOWN_BLOCK_TAG with the same tag name.

Parameters
tree:BlockTagTree

the tree node

Returns:boolean

true if this taglet accepts this tree node

createWithDefaultForNestedback to summary
pack-priv static SimpleTaglet createWithDefaultForNested(HtmlConfiguration config, DocTree.Kind tagKind, String header, Set<Taglet.Location> locations, boolean enabled)

Constructs a SimpleTaglet that will look for tags on enclosing type elements if there are no relevant tags on a nested (member) type element.

Parameters
tagKind:DocTree.Kind

the kind of this tag

header:String

the header to output

locations:Set<Taglet.Location>

the possible locations that this tag can appear in

enabled:boolean

whether this tag is enabled

extractFirstback to summary
private Optional<SimpleTaglet.Documentation> extractFirst(ExecutableElement m)
getAllBlockTagOutputback to summary
public Content getAllBlockTagOutput(Element holder, TagletWriter tagletWriter)

Overrides jdk.javadoc.internal.doclets.formats.html.taglets.BaseTaglet.getAllBlockTagOutput.

Implements jdk.javadoc.internal.doclets.formats.html.taglets.Taglet.getAllBlockTagOutput.

Doc from jdk.javadoc.internal.doclets.formats.html.taglets.BaseTaglet.getAllBlockTagOutput.

Returns the content to be included in the generated output for all instances of block tags handled by this taglet.

Annotations
@Override
getBlockTagsback to summary
private List<? extends BlockTagTree> getBlockTags(Element e)
getDefaultBlockTagsback to summary
protected List<? extends BlockTagTree> getDefaultBlockTags(Element e, Predicate<? super BlockTagTree> accepts)
getLocationsback to summary
private static Set<Taglet.Location> getLocations(String locations)
inheritback to summary
public InheritableTaglet.Output inherit(Element dst, Element src, DocTree tag, boolean isFirstSentence)

Implements jdk.javadoc.internal.doclets.formats.html.taglets.InheritableTaglet.inherit.

Annotations
@Override
isEnabledback to summary
pack-priv boolean isEnabled()

Whether the taglet should generate output. Standard tags like @author, @since, @version can be disabled by command-line options; custom tags created with -tag can be disabled with an X in the defining string.

isEnabledback to summary
private static boolean isEnabled(String locations)
simpleBlockTagOutputback to summary
private Content simpleBlockTagOutput(Element element, List<? extends DocTree> simpleTags, String header)

Returns the output for a series of simple tags.

Parameters
element:Element

The element that owns the doc comment

simpleTags:List<? extends DocTree>

the list of simple tags

header:String

the header for the series of tags

Returns:Content

the output

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

pack-priv final Record SimpleTaglet.Documentation

extends Record
Class Inheritance
Record Components
tag:DocTree 
description:List<? extends DocTree> 
method:ExecutableElement 

Field Summary

Modifier and TypeField and Description
private final List<? extends DocTree>
description

Record Component accessed by description().

private final ExecutableElement
method

Record Component accessed by method().

private final DocTree
tag

Record Component accessed by tag().

Constructor Summary

AccessConstructor and Description
pack-priv
Documentation(DocTree tag, List<? extends DocTree> description, ExecutableElement method)

Method Summary

Modifier and TypeMethod and Description
public List<? extends DocTree>
description()

Record Component getter of description.

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public ExecutableElement
method()

Record Component getter of method.

public DocTree
tag()

Record Component getter of tag.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

descriptionback to summary
private final List<? extends DocTree> description

Record Component accessed by description().

methodback to summary
private final ExecutableElement method

Record Component accessed by method().

tagback to summary
private final DocTree tag

Record Component accessed by tag().

Constructor Detail

Documentationback to summary
pack-priv Documentation(DocTree tag, List<? extends DocTree> description, ExecutableElement method)

Method Detail

descriptionback to summary
public List<? extends DocTree> description()

Record Component getter of description.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

methodback to summary
public ExecutableElement method()

Record Component getter of method.

tagback to summary
public DocTree tag()

Record Component getter of tag.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.