Interface ExceptionsAttribute
- All Superinterfaces:
Attribute<ExceptionsAttribute>
,ClassFileElement
,MethodElement
Models the
Exceptions
attribute (JVMS 4.7.5), which can appear on
methods, and records the exceptions declared to be thrown by this method.
Delivered as a MethodElement
when traversing the elements of a
MethodModel
.
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:
- 24
-
Method Summary
Modifier and TypeMethodDescriptionReturns the exceptions declared to be thrown by this method.static ExceptionsAttribute
of
(ClassEntry... exceptions) Returns anExceptions
attribute.static ExceptionsAttribute
of
(List<ClassEntry> exceptions) Returns anExceptions
attribute.static ExceptionsAttribute
Returns anExceptions
attribute.static ExceptionsAttribute
Returns anExceptions
attribute.Methods declared in interface java.lang.classfile.Attribute
attributeMapper, attributeName
-
Method Details
-
exceptions
List<ClassEntry> 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
-