Interface ExceptionsAttribute

All Superinterfaces:
Attribute<ExceptionsAttribute>, ClassfileElement, MethodElement, WritableElement<ExceptionsAttribute>
All Known Implementing Classes:
BoundAttribute.BoundExceptionsAttribute, UnboundAttribute.UnboundExceptionsAttribute

Models the Exceptions attribute , 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.
  • 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

      static ExceptionsAttribute of(List<ClassEntry> exceptions)
      Returns an Exceptions attribute.
      Parameters:
      exceptions - the checked exceptions that may be thrown from this method
      Returns:
      an Exceptions attribute
    • of

      static ExceptionsAttribute of(ClassEntry... exceptions)
      Returns an Exceptions attribute.
      Parameters:
      exceptions - the checked exceptions that may be thrown from this method
      Returns:
      an Exceptions attribute
    • ofSymbols

      static ExceptionsAttribute ofSymbols(List<ClassDesc> exceptions)
      Returns an Exceptions attribute.
      Parameters:
      exceptions - the checked exceptions that may be thrown from this method
      Returns:
      an Exceptions attribute
    • ofSymbols

      static ExceptionsAttribute ofSymbols(ClassDesc... exceptions)
      Returns an Exceptions attribute.
      Parameters:
      exceptions - the checked exceptions that may be thrown from this method
      Returns:
      an Exceptions attribute