A - the attribute typeClassFileElementAnnotationDefaultAttribute, BootstrapMethodsAttribute, CharacterRangeTableAttribute, CodeAttribute, CompilationIDAttribute, ConstantValueAttribute, DeprecatedAttribute, EnclosingMethodAttribute, ExceptionsAttribute, InnerClassesAttribute, LineNumberTableAttribute, LocalVariableTableAttribute, LocalVariableTypeTableAttribute, MethodParametersAttribute, ModuleAttribute, ModuleHashesAttribute, ModuleMainClassAttribute, ModulePackagesAttribute, ModuleResolutionAttribute, ModuleTargetAttribute, NestHostAttribute, NestMembersAttribute, PermittedSubclassesAttribute, RecordAttribute, RuntimeInvisibleAnnotationsAttribute, RuntimeInvisibleParameterAnnotationsAttribute, RuntimeInvisibleTypeAnnotationsAttribute, RuntimeVisibleAnnotationsAttribute, RuntimeVisibleParameterAnnotationsAttribute, RuntimeVisibleTypeAnnotationsAttribute, SignatureAttribute, SourceDebugExtensionAttribute, SourceFileAttribute, SourceIDAttribute, StackMapTableAttribute, SyntheticAttribute, UnknownAttributeCustomAttributepublic sealed interface Attribute<A extends Attribute<A>> extends ClassFileElement permits AnnotationDefaultAttribute, BootstrapMethodsAttribute, CharacterRangeTableAttribute, CodeAttribute, CompilationIDAttribute, ConstantValueAttribute, DeprecatedAttribute, EnclosingMethodAttribute, ExceptionsAttribute, InnerClassesAttribute, LineNumberTableAttribute, LocalVariableTableAttribute, LocalVariableTypeTableAttribute, MethodParametersAttribute, ModuleAttribute, ModuleHashesAttribute, ModuleMainClassAttribute, ModulePackagesAttribute, ModuleResolutionAttribute, ModuleTargetAttribute, NestHostAttribute, NestMembersAttribute, PermittedSubclassesAttribute, RecordAttribute, RuntimeInvisibleAnnotationsAttribute, RuntimeInvisibleParameterAnnotationsAttribute, RuntimeInvisibleTypeAnnotationsAttribute, RuntimeVisibleAnnotationsAttribute, RuntimeVisibleParameterAnnotationsAttribute, RuntimeVisibleTypeAnnotationsAttribute, SignatureAttribute, SourceDebugExtensionAttribute, SourceFileAttribute, SourceIDAttribute, StackMapTableAttribute, SyntheticAttribute, UnknownAttribute, CustomAttribute<T> (not exhaustive)
class file format. Attributes exist on certain class file structures modeled by AttributedElement, which provides basic read access to the attributes. This sealed interface hierarchy includes attributes predefined in the JVMS and JDK-specific nonstandard attributes. Their mappers are available in Attributes. Two special subtypes of
Attribute are CustomAttribute, which all user-defined attributes should extend from, and UnknownAttribute, representing attributes read from class file but are not recognized by the ClassFile.AttributeMapperOption.
Attributes are read through AttributedElement or element traversal of a CompoundElement; they are written through ClassFileBuilder. See Reading Attributes and Writing Attributes for more details.
| Modifier and Type | Method | Description |
|---|---|---|
AttributeMapper |
attributeMapper() |
Returns the AttributeMapper associated with this attribute. |
Utf8Entry |
attributeName() |
Returns the name of the attribute. |
Utf8Entry attributeName()
attributeMapper().name(). If this attribute is read from a class file, this method returns the Utf8Entry indicating the attribute name in the class file.
AttributeMapper<A> attributeMapper()
AttributeMapper associated with this attribute.AttributeMapper associated with this attribute
© 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.html