Interface ExceptionsAttribute
- 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 MethodElementPREVIEW when traversing the elements of a
MethodModelPREVIEW.
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 ExceptionsAttributePREVIEWof(ClassEntryPREVIEW... exceptions) Returns anExceptionsattribute.static ExceptionsAttributePREVIEWof(List<ClassEntryPREVIEW> exceptions) Returns anExceptionsattribute.static ExceptionsAttributePREVIEWReturns anExceptionsattribute.static ExceptionsAttributePREVIEWReturns anExceptionsattribute.Methods declared in interface java.lang.classfile.AttributePREVIEW
attributeMapper, attributeNameMethods 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 anExceptionsattribute.- Parameters:
exceptions- the checked exceptions that may be thrown from this method- Returns:
- an
Exceptionsattribute
-
of
Returns anExceptionsattribute.- Parameters:
exceptions- the checked exceptions that may be thrown from this method- Returns:
- an
Exceptionsattribute
-
ofSymbols
Returns anExceptionsattribute.- Parameters:
exceptions- the checked exceptions that may be thrown from this method- Returns:
- an
Exceptionsattribute
-
ofSymbols
Returns anExceptionsattribute.- Parameters:
exceptions- the checked exceptions that may be thrown from this method- Returns:
- an
Exceptionsattribute
-
ExceptionsAttributewhen preview features are enabled.