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

public Class ThrowsTaglet

extends BaseTaglet
implements InheritableTaglet
Class Inheritance
All Implemented Interfaces
jdk.javadoc.internal.doclets.formats.html.taglets.InheritableTaglet
Imports
java.util.Arrays, .EnumSet, .HashMap, .HashSet, .LinkedHashMap, .LinkedList, .List, .Locale, .Map, .Optional, .Set, javax.lang.model.element.Element, .ElementKind, .ExecutableElement, .ModuleElement, .PackageElement, .QualifiedNameable, .TypeElement, .TypeParameterElement, javax.lang.model.type.ExecutableType, .TypeMirror, javax.lang.model.util.Types, com.sun.source.doctree.DocTree, .InheritDocTree, .ThrowsTree, jdk.javadoc.doclet.Taglet, jdk.javadoc.internal.doclets.formats.html.Contents, .HtmlConfiguration, .HtmlLinkInfo, jdk.javadoc.internal.doclets.toolkit.util.DocFinder, .Utils, .VisibleMemberTable, jdk.javadoc.internal.html.Content, .ContentBuilder, .HtmlTree

A taglet that processes ThrowsTree, which represents @throws and @exception tags, collectively referred to as exception tags.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
private final HtmlConfiguration
private final Contents
Inherited from jdk.javadoc.internal.doclets.formats.html.taglets.BaseTaglet:
messagesnameresourcestagKindtagletWriterutils

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static String
private static String
private Map<ThrowsTree, ExecutableElement>
private List<ThrowsTree>
findByTypeElement(Element targetExceptionType, ExecutableElement executable)

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 Content
private Element
private Map<TypeMirror, TypeMirror>

Returns:

map of declared to instantiated thrown types or an empty map.
getSubstitutedThrownTypes
(Types types, List<? extends TypeMirror>
the originally declared thrown types.
declaredThrownTypes
,
List<? extends TypeMirror>
the thrown types in the context of the current type.
instantiatedThrownTypes
)

Returns a map of substitutions for a list of thrown types with the original type-variable as a key and the instantiated type as a value.

private Content

Returns:

the header for the throws tag
getThrowsHeader
()

Returns the header for the @throws tag.

private static int
public InheritableTaglet.Output
private static AssertionError
private void
outputAnExceptionTagDeeply(ThrowsTaglet.ExceptionSectionBuilder exceptionSection, Element originalExceptionElement, ThrowsTree tag, ExecutableElement holder, Set<TypeMirror> alreadyDocumentedExceptions, Map<TypeMirror, TypeMirror> typeSubstitutions)

private void
outputAnExceptionTagDeeply(ThrowsTaglet.ExceptionSectionBuilder exceptionSection, Element originalExceptionElement, ThrowsTree tag, ExecutableElement holder, boolean beginNewEntry, Set<TypeMirror> alreadyDocumentedExceptions, Map<TypeMirror, TypeMirror> typeSubstitutions)

private Content

Returns:

the output
throwsTagOutput
(TypeMirror
the type that is thrown
throwsType
,
Optional<Content>
the optional content to add as a description
content
)

Returns the output for a default @throws tag.

private static Map<ThrowsTree, ExecutableElement>
private static DocFinder.Result<Map<ThrowsTree, ExecutableElement>>
Inherited from jdk.javadoc.internal.doclets.formats.html.taglets.BaseTaglet:
getAllowedLocationsgetInlineTagOutputgetNamegetTagKindisInlineTag

Field Detail

configback to summary
private final HtmlConfiguration config

Hides jdk.javadoc.internal.doclets.formats.html.taglets.BaseTaglet.config.

contentsback to summary
private final Contents contents

Constructor Detail

ThrowsTagletback to summary
pack-priv ThrowsTaglet(HtmlConfiguration config)

Method Detail

detailedDescriptionOfback to summary
private static String detailedDescriptionOf(Element e)
diagnosticDescriptionOfback to summary
private static String diagnosticDescriptionOf(Element e)
expandShallowlyback to summary
private Map<ThrowsTree, ExecutableElement> expandShallowly(Element exceptionType, ExecutableElement holder, Optional<ExecutableElement> src) throws ExceptionTypeNotFound, NotExceptionType, Invalid, UnsupportedTypeParameter, NoOverriddenMethodFound
findByTypeElementback to summary
private List<ThrowsTree> findByTypeElement(Element targetExceptionType, ExecutableElement executable) throws ExceptionTypeNotFound, NotExceptionType
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
getAllBlockTagOutput0back to summary
private Content getAllBlockTagOutput0(Element holder) throws ExceptionTypeNotFound, NotExceptionType, Invalid, Undocumented, UnsupportedTypeParameter, NoOverrideFound, NoOverriddenMethodFound
getExceptionTypeback to summary
private Element getExceptionType(ThrowsTree tag, ExecutableElement holder) throws ExceptionTypeNotFound, NotExceptionType
getSubstitutedThrownTypesback to summary
private Map<TypeMirror, TypeMirror> getSubstitutedThrownTypes(Types types, List<? extends TypeMirror> declaredThrownTypes, List<? extends TypeMirror> instantiatedThrownTypes)

Returns a map of substitutions for a list of thrown types with the original type-variable as a key and the instantiated type as a value. If no types need to be substituted an empty map is returned.

Parameters
declaredThrownTypes:List<? extends TypeMirror>

the originally declared thrown types.

instantiatedThrownTypes:List<? extends TypeMirror>

the thrown types in the context of the current type.

Returns:Map<TypeMirror, TypeMirror>

map of declared to instantiated thrown types or an empty map.

getThrowsHeaderback to summary
private Content getThrowsHeader()

Returns the header for the @throws tag.

Returns:Content

the header for the throws tag

indexOfInheritDocback to summary
private static int indexOfInheritDoc(ThrowsTree tag, ExecutableElement holder) throws Invalid
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
newAssertionErrorback to summary
private static AssertionError newAssertionError(Object... objects)
outputAnExceptionTagDeeplyback to summary
private void outputAnExceptionTagDeeply(ThrowsTaglet.ExceptionSectionBuilder exceptionSection, Element originalExceptionElement, ThrowsTree tag, ExecutableElement holder, Set<TypeMirror> alreadyDocumentedExceptions, Map<TypeMirror, TypeMirror> typeSubstitutions) throws ExceptionTypeNotFound, NotExceptionType, Invalid, Undocumented, UnsupportedTypeParameter, NoOverrideFound, NoOverriddenMethodFound
outputAnExceptionTagDeeplyback to summary
private void outputAnExceptionTagDeeply(ThrowsTaglet.ExceptionSectionBuilder exceptionSection, Element originalExceptionElement, ThrowsTree tag, ExecutableElement holder, boolean beginNewEntry, Set<TypeMirror> alreadyDocumentedExceptions, Map<TypeMirror, TypeMirror> typeSubstitutions) throws ExceptionTypeNotFound, NotExceptionType, Invalid, Undocumented, UnsupportedTypeParameter, NoOverrideFound, NoOverriddenMethodFound
throwsTagOutputback to summary
private Content throwsTagOutput(TypeMirror throwsType, Optional<Content> content)

Returns the output for a default @throws tag.

Parameters
throwsType:TypeMirror

the type that is thrown

content:Optional<Content>

the optional content to add as a description

Returns:Content

the output

toExceptionTagsback to summary
private static Map<ThrowsTree, ExecutableElement> toExceptionTags(ExecutableElement holder, List<ThrowsTree> tags)
toResultback to summary
private static DocFinder.Result<Map<ThrowsTree, ExecutableElement>> toResult(Element target, ExecutableElement holder, List<ThrowsTree> tags)
jdk.javadoc.internal.doclets.formats.html.taglets back to summary

private Class ThrowsTaglet.ExceptionSectionBuilder

extends Object
Class Inheritance
  • java.lang.Object
  • jdk.javadoc.internal.doclets.formats.html.taglets.ThrowsTaglet.ExceptionSectionBuilder

Field Summary

Modifier and TypeField and Description
private boolean
private Content
private TypeMirror
private boolean
private final Content
private final ThrowsTaglet
private final TagletWriter

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
beginEntry(TypeMirror exceptionType)

pack-priv Content
pack-priv void
pack-priv boolean
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

beganback to summary
private boolean began
currentback to summary
private Content current
exceptionTypeback to summary
private TypeMirror exceptionType
headerAddedback to summary
private boolean headerAdded
resultback to summary
private final Content result
tagletback to summary
private final ThrowsTaglet taglet
writerback to summary
private final TagletWriter writer

Constructor Detail

ExceptionSectionBuilderback to summary
pack-priv ExceptionSectionBuilder(TagletWriter writer, ThrowsTaglet taglet)

Method Detail

beginEntryback to summary
pack-priv void beginEntry(TypeMirror exceptionType)
buildback to summary
pack-priv Content build()
continueEntryback to summary
pack-priv void continueEntry(Content c)
debugEntryBegunback to summary
pack-priv boolean debugEntryBegun()
endEntryback to summary
public void endEntry()
jdk.javadoc.internal.doclets.formats.html.taglets back to summary

private sealed Class ThrowsTaglet.Failure

extends Exception
permits ExceptionTypeNotFound, NotExceptionType, Invalid, Undocumented, UnsupportedTypeParameter, NoOverrideFound
Class Inheritance
Known Direct Subclasses
jdk.javadoc.internal.doclets.formats.html.taglets.ThrowsTaglet.Failure.ExceptionTypeNotFound, jdk.javadoc.internal.doclets.formats.html.taglets.ThrowsTaglet.Failure.NotExceptionType, jdk.javadoc.internal.doclets.formats.html.taglets.ThrowsTaglet.Failure.Invalid, jdk.javadoc.internal.doclets.formats.html.taglets.ThrowsTaglet.Failure.Undocumented, jdk.javadoc.internal.doclets.formats.html.taglets.ThrowsTaglet.Failure.UnsupportedTypeParameter, jdk.javadoc.internal.doclets.formats.html.taglets.ThrowsTaglet.Failure.NoOverrideFound
Annotations
@SuppressWarnings:serial

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final ExecutableElement
private final DocTree

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv ExecutableElement
pack-priv DocTree
tag()

Field Detail

holderback to summary
private final ExecutableElement holder
tagback to summary
private final DocTree tag

Constructor Detail

Failureback to summary
pack-priv Failure(DocTree tag, ExecutableElement holder)

Method Detail

holderback to summary
pack-priv ExecutableElement holder()
tagback to summary
pack-priv DocTree tag()
jdk.javadoc.internal.doclets.formats.html.taglets back to summary

pack-priv final Class ThrowsTaglet.Failure.ExceptionTypeNotFound

extends Failure
Class Inheritance

Constructor Summary

AccessConstructor and Description
pack-priv

Constructor Detail

ExceptionTypeNotFoundback to summary
pack-priv ExceptionTypeNotFound(ThrowsTree tag, ExecutableElement holder)
jdk.javadoc.internal.doclets.formats.html.taglets back to summary

pack-priv final Class ThrowsTaglet.Failure.Invalid

extends Failure
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Constructor Detail

Invalidback to summary
public Invalid(DocTree tag, ExecutableElement holder)
jdk.javadoc.internal.doclets.formats.html.taglets back to summary

pack-priv final Class ThrowsTaglet.Failure.NoOverrideFound

extends Failure
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final InheritDocTree

Constructor Summary

AccessConstructor and Description
public

Field Detail

inheritDocback to summary
private final InheritDocTree inheritDoc

Constructor Detail

NoOverrideFoundback to summary
public NoOverrideFound(DocTree tag, ExecutableElement holder, InheritDocTree inheritDoc)
jdk.javadoc.internal.doclets.formats.html.taglets back to summary

pack-priv final Class ThrowsTaglet.Failure.NotExceptionType

extends Failure
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Element

Constructor Summary

AccessConstructor and Description
public

Field Detail

typeback to summary
private final Element type

Constructor Detail

NotExceptionTypeback to summary
public NotExceptionType(ThrowsTree tag, ExecutableElement holder, Element type)
jdk.javadoc.internal.doclets.formats.html.taglets back to summary

pack-priv final Class ThrowsTaglet.Failure.Undocumented

extends Failure
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Element

Constructor Summary

AccessConstructor and Description
public
Undocumented(DocTree tag, ExecutableElement holder, Element exceptionElement)

Field Detail

exceptionElementback to summary
private final Element exceptionElement

Constructor Detail

Undocumentedback to summary
public Undocumented(DocTree tag, ExecutableElement holder, Element exceptionElement)
jdk.javadoc.internal.doclets.formats.html.taglets back to summary

pack-priv final Class ThrowsTaglet.Failure.UnsupportedTypeParameter

extends Failure
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Element

Constructor Summary

AccessConstructor and Description
public

Field Detail

elementback to summary
private final Element element

Constructor Detail

UnsupportedTypeParameterback to summary
public UnsupportedTypeParameter(Element element, ThrowsTree tag, ExecutableElement holder)