Interface PermittedSubclassesAttribute

All Superinterfaces:
Attribute<PermittedSubclassesAttribute>, ClassElement, ClassFileElement

public sealed interface PermittedSubclassesAttribute extends Attribute<PermittedSubclassesAttribute>, ClassElement
Models the PermittedSubclasses attribute (JVMS 4.7.31), which can appear on classes to indicate which classes may extend this class. Delivered as a ClassElement when traversing the elements of a ClassModel.

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.

The attribute was introduced in the Java SE Platform version 17.

Since:
24
  • Method Details

    • permittedSubclasses

      List<ClassEntry> permittedSubclasses()
      Returns the list of permitted subclasses.
      Returns:
      the list of permitted subclasses
    • of

      static PermittedSubclassesAttribute of(List<ClassEntry> permittedSubclasses)
      Returns a PermittedSubclasses attribute.
      Parameters:
      permittedSubclasses - the permitted subclasses
      Returns:
      a PermittedSubclasses attribute
    • of

      static PermittedSubclassesAttribute of(ClassEntry... permittedSubclasses)
      Returns a PermittedSubclasses attribute.
      Parameters:
      permittedSubclasses - the permitted subclasses
      Returns:
      a PermittedSubclasses attribute
    • ofSymbols

      static PermittedSubclassesAttribute ofSymbols(List<ClassDesc> permittedSubclasses)
      Returns a PermittedSubclasses attribute.
      Parameters:
      permittedSubclasses - the permitted subclasses
      Returns:
      a PermittedSubclasses attribute
    • ofSymbols

      static PermittedSubclassesAttribute ofSymbols(ClassDesc... permittedSubclasses)
      Returns a PermittedSubclasses attribute.
      Parameters:
      permittedSubclasses - the permitted subclasses
      Returns:
      a PermittedSubclasses attribute