- All Superinterfaces:
AttributePREVIEW<ExceptionsAttributePREVIEW>
,ClassFileElementPREVIEW
,MethodElementPREVIEW
,WritableElementPREVIEW<ExceptionsAttributePREVIEW>
public sealed interface ExceptionsAttribute
extends AttributePREVIEW<ExceptionsAttributePREVIEW>, MethodElementPREVIEW
ExceptionsAttribute
is a preview API of the Java platform.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Models the
Exceptions
attribute 4.7.5, which can appear on
methods, and records the exceptions declared to be thrown by this method.
Delivered as a MethodElement
PREVIEW when traversing the elements of a
MethodModel
PREVIEW.
The attribute does not permit multiple instances in a given location. Subsequent occurrence of the attribute takes precedence during the attributed element build or transformation.
- Since:
- 22
-
Method Summary
Modifier and TypeMethodDescriptionReturns the exceptions declared to be thrown by this method.static ExceptionsAttributePREVIEW
of
(ClassEntryPREVIEW... exceptions) Returns anExceptions
attribute.static ExceptionsAttributePREVIEW
of
(List<ClassEntryPREVIEW> exceptions) Returns anExceptions
attribute.static ExceptionsAttributePREVIEW
Returns anExceptions
attribute.static ExceptionsAttributePREVIEW
Returns anExceptions
attribute.Methods declared in interface java.lang.classfile.AttributePREVIEW
attributeMapper, attributeName
Methods declared in interface java.lang.classfile.WritableElementPREVIEW
writeTo
-
Method Details
-
exceptions
List<ClassEntryPREVIEW> exceptions()Returns the exceptions declared to be thrown by this method.- Returns:
- the exceptions declared to be thrown by this method
-
of
Returns anExceptions
attribute.- Parameters:
exceptions
- the checked exceptions that may be thrown from this method- Returns:
- an
Exceptions
attribute
-
of
Returns anExceptions
attribute.- Parameters:
exceptions
- the checked exceptions that may be thrown from this method- Returns:
- an
Exceptions
attribute
-
ofSymbols
Returns anExceptions
attribute.- Parameters:
exceptions
- the checked exceptions that may be thrown from this method- Returns:
- an
Exceptions
attribute
-
ofSymbols
Returns anExceptions
attribute.- Parameters:
exceptions
- the checked exceptions that may be thrown from this method- Returns:
- an
Exceptions
attribute
-
ExceptionsAttribute
when preview features are enabled.