Module java.base
Package java.lang.classfile.attribute

# Interface EnclosingMethodAttribute

≠
public abstract sealed interface EnclosingMethodAttribute
extends java.lang.classfile.Attribute<java.lang.classfile.attribute.EnclosingMethodAttribute>, java.lang.classfile.ClassElement
permits jdk.internal.classfile.impl.BoundAttribute.BoundEnclosingMethodAttribute, jdk.internal.classfile.impl.UnboundAttribute.UnboundEnclosingMethodAttribute
Comparing jdk-master and valhalla-csr-open

All Superinterfaces:
  `AttributePREVIEW <EnclosingMethodAttribute>, ClassElementPREVIEW , ClassFileElement`

public sealed interface EnclosingMethodAttribute extends AttributePREVIEW <EnclosingMethodAttribute>, ClassElementPREVIEW
Models the `EnclosingMethod` attribute (JVMS §4.7.7), which indicates that this class is a local or anonymous class, and indicates the enclosing method or constructor of this class if this class is enclosed in exactly one method or constructor.

This attribute only appears on classes, and does not permit multiple instances in a class. It has a data dependency on the constant pool.

The attribute was introduced in the Java SE Platform version 5.0, major version 49.

See Java Virtual Machine Specification:
  4.7.7 The `EnclosingMethod` Attribute
Since:
  24
See Also:
  - `Attributes.enclosingMethod()`

## Methods

- =
  public abstract java.lang.classfile.constantpool.ClassEntry enclosingClass()
- =
  public abstract java.util.Optional<java.lang.classfile.constantpool.NameAndTypeEntry> enclosingMethod()
- =
  public default java.util.Optional<java.lang.classfile.constantpool.Utf8Entry> enclosingMethodName()
- =
  public default java.util.Optional<java.lang.classfile.constantpool.Utf8Entry> enclosingMethodType()
- =
  public default java.util.Optional<java.lang.constant.MethodTypeDesc> enclosingMethodTypeSymbol()
- =
  public static java.lang.classfile.attribute.EnclosingMethodAttribute of(java.lang.classfile.constantpool.ClassEntry arg0, java.util.Optional<java.lang.classfile.constantpool.NameAndTypeEntry> arg1)
- =
  public static java.lang.classfile.attribute.EnclosingMethodAttribute of(java.lang.constant.ClassDesc arg0, java.util.Optional<java.lang.String> arg1, java.util.Optional<java.lang.constant.MethodTypeDesc> arg2)

## Summary

Differences
| Elements | Comments | Descriptions | Total
Added | Changed | Removed | Added | Changed | Removed | Added | Changed | Removed
--- | --- | --- | --- | --- | --- | --- | --- | ---
EnclosingMethodAttribute |  |  |  |  |  |  | 4 |  |  | 4
Total |  |  |  |  |  |  | 4 |  |  | 4