Attribute<PermittedSubclassesAttribute>, ClassElement, ClassFileElementpublic sealed interface PermittedSubclassesAttribute extends Attribute<PermittedSubclassesAttribute>, ClassElement
PermittedSubclasses attribute (JVMS 4.7.31), which indicates this class or interface is sealed, and which classes or interfaces may extend or implement this class or interface. 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 17, major version 61.
sealed, non-sealed, and final Classessealed and non-sealed InterfacesPermittedSubclasses Attribute| Modifier and Type | Method | Description |
|---|---|---|
static PermittedSubclassesAttribute |
of |
Returns a PermittedSubclasses attribute. |
static PermittedSubclassesAttribute |
of |
Returns a PermittedSubclasses attribute. |
static PermittedSubclassesAttribute |
ofSymbols |
Returns a PermittedSubclasses attribute. |
static PermittedSubclassesAttribute |
ofSymbols |
Returns a PermittedSubclasses attribute. |
List |
permittedSubclasses() |
Returns the list of permitted subclasses or subinterfaces. |
attributeMapper, attributeName
List<ClassEntry> permittedSubclasses()
static PermittedSubclassesAttribute of(List<ClassEntry> permittedSubclasses)
PermittedSubclasses attribute.permittedSubclasses - the permitted subclasses or subinterfacesPermittedSubclasses attributestatic PermittedSubclassesAttribute of(ClassEntry... permittedSubclasses)
PermittedSubclasses attribute.permittedSubclasses - the permitted subclasses or subinterfacesPermittedSubclasses attributestatic PermittedSubclassesAttribute ofSymbols(List<ClassDesc> permittedSubclasses)
PermittedSubclasses attribute.permittedSubclasses - the permitted subclasses or subinterfacesPermittedSubclasses attributeIllegalArgumentException - if any of permittedSubclasses is primitivestatic PermittedSubclassesAttribute ofSymbols(ClassDesc... permittedSubclasses)
PermittedSubclasses attribute.permittedSubclasses - the permitted subclasses or subinterfacesPermittedSubclasses attributeIllegalArgumentException - if any of permittedSubclasses is primitive
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/classfile/attribute/PermittedSubclassesAttribute.html