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

public Class SnippetTaglet

extends BaseTaglet
Class Inheritance
Imports
java.io.IOException, java.util.EnumSet, .HashMap, .HashSet, .Map, .Objects, .Optional, .Set, java.util.stream.Collectors, javax.lang.model.element.Element, .PackageElement, javax.tools.Diagnostic, .DocumentationTool, .FileObject, com.sun.source.doctree.AttributeTree, .DocTree, .SnippetTree, .TextTree, com.sun.source.util.DocTreePath, jdk.javadoc.doclet.Taglet, jdk.javadoc.internal.doclets.formats.html.HtmlConfiguration, .HtmlDocletWriter, jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyles, jdk.javadoc.internal.doclets.formats.html.taglets.snippet.Action, .ParseException, .Parser, .Style, .StyledText, jdk.javadoc.internal.doclets.toolkit.DocletElement, .Resources, jdk.javadoc.internal.doclets.toolkit.util.DocPaths, .Utils, jdk.javadoc.internal.html.Content, .HtmlAttr, .HtmlTag, .HtmlTree, .Text

A taglet that represents the @snippet tag.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
public static interface
public static enum

Field Summary

Modifier and TypeField and Description
private final HashMap<HtmlDocletWriter, Set<String>>
Inherited from jdk.javadoc.internal.doclets.formats.html.taglets.BaseTaglet:
configmessagesnameresourcestagKindtagletWriterutils

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private Content
private static String
diff(String inline, String external)

private void
error(TagletWriter writer, Element holder, DocTree tag, String key, Object... args)

private Content
public Content
getInlineTagOutput(Element holder, DocTree tag, TagletWriter tagletWriter)

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

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

Returns the content to be included in the generated output for an instance of an inline tag handled by this taglet.

private Element
getLinkedElement(Element referer, String signature)

private static PackageElement
private String
private StyledText
parse(Resources resources, SnippetTaglet.Diags diags, SnippetTaglet.Language language, String content)

private Content

Returns:

the output
snippetTagOutput
(Element
The element that owns the doc comment
element
,
SnippetTree
the snippet tag
tag
,
StyledText content, String
the value of the id attribute, or null if not defined
id
,
String
the value of the lang attribute, or null if not defined
lang
)

Returns the output for a {@snippet ...} tag.

private static String
private static StyledText
Inherited from jdk.javadoc.internal.doclets.formats.html.taglets.BaseTaglet:
getAllBlockTagOutputgetAllowedLocationsgetNamegetTagKindisInlineTag

Field Detail

idsback to summary
private final HashMap<HtmlDocletWriter, Set<String>> ids

Constructor Detail

SnippetTagletback to summary
pack-priv SnippetTaglet(HtmlConfiguration config)

Method Detail

badSnippetback to summary
private Content badSnippet(TagletWriter writer, Optional<String> details)
diffback to summary
private static String diff(String inline, String external)
errorback to summary
private void error(TagletWriter writer, Element holder, DocTree tag, String key, Object... args)
generateContentback to summary
private Content generateContent(Element holder, DocTree tag) throws BadSnippetException
getInlineTagOutputback to summary
public Content getInlineTagOutput(Element holder, DocTree tag, TagletWriter tagletWriter)

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

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

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

Returns the content to be included in the generated output for an instance of an inline tag handled by this taglet.

Annotations
@Override
getLinkedElementback to summary
private Element getLinkedElement(Element referer, String signature)
getPackageElementback to summary
private static PackageElement getPackageElement(Element e, Utils utils)
languageFromFileNameback to summary
private String languageFromFileName(String fileName)
parseback to summary
private StyledText parse(Resources resources, SnippetTaglet.Diags diags, SnippetTaglet.Language language, String content) throws ParseException
snippetTagOutputback to summary
private Content snippetTagOutput(Element element, SnippetTree tag, StyledText content, String id, String lang)

Returns the output for a {@snippet ...} tag.

Parameters
element:Element

The element that owns the doc comment

tag:SnippetTree

the snippet tag

id:String

the value of the id attribute, or null if not defined

lang:String

the value of the lang attribute, or null if not defined

Returns:Content

the output

stringValueOfback to summary
private static String stringValueOf(AttributeTree at) throws BadSnippetException
toDisplayFormback to summary
private static StyledText toDisplayForm(StyledText source)
jdk.javadoc.internal.doclets.formats.html.taglets back to summary

private final Class SnippetTaglet.BadSnippetException

extends Exception
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final transient Object[]
private final String
private static final long
private final transient DocTree

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv Object[]
args()

pack-priv String
key()

pack-priv DocTree
tag()

Field Detail

argsback to summary
private final transient Object[] args
keyback to summary
private final String key
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.Exception.serialVersionUID.

Annotations
@Serial
tagback to summary
private final transient DocTree tag

Constructor Detail

BadSnippetExceptionback to summary
pack-priv BadSnippetException(DocTree tag, String key, Object... args)

Method Detail

argsback to summary
pack-priv Object[] args()
keyback to summary
pack-priv String key()
tagback to summary
pack-priv DocTree tag()
jdk.javadoc.internal.doclets.formats.html.taglets back to summary

public Interface SnippetTaglet.Diags


Method Summary

Modifier and TypeMethod and Description
public void
warn(String key, int pos)

Method Detail

warnback to summary
public void warn(String key, int pos)
jdk.javadoc.internal.doclets.formats.html.taglets back to summary

public final Enum SnippetTaglet.Language

extends Enum<SnippetTaglet.Language>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final SnippetTaglet.Language
public static final SnippetTaglet.Language

Constructor Summary

AccessConstructor and Description
private

Method Summary

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

Field Detail

JAVAback to summary
public static final SnippetTaglet.Language JAVA
PROPERTIESback to summary
public static final SnippetTaglet.Language PROPERTIES

Constructor Detail

Languageback to summary
private Language()

Method Detail

valueOfback to summary
public static SnippetTaglet.Language valueOf(String name)
valuesback to summary
public static SnippetTaglet.Language[] values()