# Uses of Interface
java.lang.classfile.Attribute

Packages that use Attribute
Package
Description
java.lang.classfile
Provides classfile parsing, generation, and transformation library.
java.lang.classfile.attribute
Provides interfaces describing `class` file attributes for the `java.lang.classfile` library.

## Uses of Attribute in java.lang.classfile

Classes in java.lang.classfile with type parameters of type Attribute
Modifier and Type
Interface
Description
`interface`
`Attribute<A extends Attribute<A>>`
Models an attribute (JVMS §4.7) in the `class` file format.
`interface`
`AttributeMapper<A extends Attribute<A>>`
Bidirectional mapper between the `class` file representation of an attribute and its API model.
Classes in java.lang.classfile that implement Attribute
Modifier and Type
Class
Description
`class`
`CustomAttribute<T extends CustomAttribute<T>>`
Models a user-defined attribute in a `class` file.
Methods in java.lang.classfile with type parameters of type Attribute
Modifier and Type
Method
Description
`default <T extends Attribute<T>>
Optional<T>`
AttributedElement.`findAttribute(AttributeMapper<T> attr)`
Finds an attribute by name.
`default <T extends Attribute<T>>
List<T>`
AttributedElement.`findAttributes(AttributeMapper<T> attr)`
Finds attributes by name.
Methods in java.lang.classfile that return types with arguments of type Attribute
Modifier and Type
Method
Description
`List<Attribute<?>>`
AttributedElement.`attributes()`
Returns the attributes of this structure.

## Uses of Attribute in java.lang.classfile.attribute

Subinterfaces of Attribute in java.lang.classfile.attribute
Modifier and Type
Interface
Description
`interface`
`AnnotationDefaultAttribute`
Models the `AnnotationDefault` attribute (JVMS §4.7.22), which records the default value (JLS §9.6.2) for the annotation interface element defined by this method.
`interface`
`BootstrapMethodsAttribute`
Models the `BootstrapMethods` attribute (JVMS §4.7.23), which stores symbolic information for the execution of bootstrap methods, used by dynamically-computed call sites and constants.
`interface`
`CharacterRangeTableAttribute`
Models the `CharacterRangeTable` attribute, which is a bidirectional mapping from ranges of positions in the source file to ranges of indices into the `code` array.
`interface`
`CodeAttribute`
Models the `Code` attribute (JVMS §4.7.3), which contains the bytecode of this method.
`interface`
`CompilationIDAttribute`
Models the `CompilationID` attribute, which records the compilation time of the `class` file.
`interface`
`ConstantValueAttribute`
Models the `ConstantValue` attribute (JVMS §4.7.2), which indicates this field's value is a constant and that constant value.
`interface`
`DeprecatedAttribute`
Models the `Deprecated` attribute (JVMS §4.7.15), which indicates this structure has been superseded.
`interface`
`EnclosingMethodAttribute`
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.
`interface`
`ExceptionsAttribute`
Models the `Exceptions` attribute (JVMS §4.7.5), which records the exceptions declared to be thrown by this method.
`interface`
`InnerClassesAttribute`
Models the `InnerClasses` attribute (JVMS §4.7.6), which records which classes referenced by this `class` file are nested classes.
`interface`
`LineNumberTableAttribute`
Models the `LineNumberTable` attribute (JVMS §4.7.12), which records the mapping between indexes into the `code` array and line numbers in the source file.
`interface`
`LoadableDescriptorsAttributePREVIEW`
Preview.
Models the `LoadableDescriptors`PREVIEW attribute (JVMS §4.7.32PREVIEW), which permits the JVM to load mentioned classes and interfaces before the `class` file carrying this attribute is loaded.
`interface`
`LocalVariableTableAttribute`
Models the `LocalVariableTable` attribute (JVMS §4.7.13), which records debug information about local variables.
`interface`
`LocalVariableTypeTableAttribute`
Models the `LocalVariableTypeTable` attribute (JVMS §4.7.14), which records debug information about local variables with generic types.
`interface`
`MethodParametersAttribute`
Models the `MethodParameters` attribute (JVMS §4.7.24), which records reflective information about this method's parameters such as access modifiers.
`interface`
`ModuleAttribute`
Models the `Module` attribute (JVMS §4.7.25), which always appears on classes that represent module descriptors.
`interface`
`ModuleHashesAttribute`
Models the `ModuleHashes` attribute, which appears on classes that represent module descriptors to capture the hashes of a set of co-delivered modules.
`interface`
`ModuleMainClassAttribute`
Models the `ModuleMainClass` attribute (JVMS §4.7.27), which appears on classes that represent module descriptors to indicate the main class of the module.
`interface`
`ModulePackagesAttribute`
Models the `ModulePackages` attribute (JVMS §4.7.26), which can appear on classes that represent module descriptors to indicate packages in the module used by the module descriptor.
`interface`
`ModuleResolutionAttribute`
Models the `ModuleResolution` attribute, which can appear on classes that represent module descriptors, to capture resolution metadata for modules.
`interface`
`ModuleTargetAttribute`
Models the `ModuleTarget` attribute, which can appear on classes that represent module descriptors, to represent constraints on the target platform.
`interface`
`NestHostAttribute`
Models the `NestHost` attribute (JVMS §4.7.28), which indicates this class is a member of a nest and the host class of the nest.
`interface`
`NestMembersAttribute`
Models the `NestMembers` attribute (JVMS §4.7.29), which indicates that this class is the host of a nest and the other nest members.
`interface`
`PermittedSubclassesAttribute`
Models the `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.
`interface`
`RecordAttribute`
Models the `Record` attribute (JVMS §4.7.30), which indicates that this class is a record class and the record components.
`interface`
`RuntimeInvisibleAnnotationsAttribute`
Models the `RuntimeInvisibleAnnotations` attribute (JVMS §4.7.17), which stores declaration annotations on this structure that are visible to `class` file consumers but are not visible to core reflection.
`interface`
`RuntimeInvisibleParameterAnnotationsAttribute`
Models the `RuntimeInvisibleParameterAnnotations` attribute (JVMS §4.7.19), which stores declaration annotations on the method parameters of this method that are visible to `class` file consumers but are not visible to core reflection.
`interface`
`RuntimeInvisibleTypeAnnotationsAttribute`
Models the `RuntimeInvisibleTypeAnnotations` attribute (JVMS §4.7.21), which stores type-use annotations for the annotated uses of types in this structure that are visible to `class` file consumers but are not visible to core reflection.
`interface`
`RuntimeVisibleAnnotationsAttribute`
Models the `RuntimeVisibleAnnotations` attribute (JVMS §4.7.16), which stores declaration annotations on this structure that are visible to both `class` file consumers and core reflection.
`interface`
`RuntimeVisibleParameterAnnotationsAttribute`
Models the `RuntimeVisibleParameterAnnotations` attribute (JVMS §4.7.18), which stores declaration annotations on the method parameters of this method that are visible to both `class` file consumers and core reflection.
`interface`
`RuntimeVisibleTypeAnnotationsAttribute`
Models the `RuntimeVisibleTypeAnnotations` attribute (JVMS §4.7.20), which stores type-use annotations for the annotated uses of types in this structure that are visible to both `class` file consumers and core reflection.
`interface`
`SignatureAttribute`
Models the `Signature` attribute (JVMS §4.7.9), which indicates the generic signature of this structure.
`interface`
`SourceDebugExtensionAttribute`
Models the `SourceDebugExtension` attribute (JVMS §4.7.11), which stores arbitrary modified UTF-8 data.
`interface`
`SourceFileAttribute`
Models the `SourceFile` attribute (JVMS §4.7.10), which indicates the name of the source file from which this `class` file was compiled.
`interface`
`SourceIDAttribute`
Models the `SourceID` attribute, which records the last modified time of the source file from which this `class` file was compiled.
`interface`
`StackMapTableAttribute`
Models the `StackMapTable` attribute (JVMS §4.7.4), which is used for verification by type checking (§4.10.1).
`interface`
`SyntheticAttribute`
Models the `Synthetic` attribute (JVMS §4.7.8), which marks a class member as implementation-specific artifacts.
`interface`
`UnknownAttribute`
Models an unknown attribute read from a `class` file.
Methods in java.lang.classfile.attribute with parameters of type Attribute
Modifier and Type
Method
Description
`static RecordComponentInfo`
RecordComponentInfo.`of(Utf8Entry name, Utf8Entry descriptor, Attribute<?>... attributes)`
Returns a record component description.
`static RecordComponentInfo`
RecordComponentInfo.`of(String name, ClassDesc descriptor, Attribute<?>... attributes)`
Returns a record component description.
Method parameters in java.lang.classfile.attribute with type arguments of type Attribute
Modifier and Type
Method
Description
`static RecordComponentInfo`
RecordComponentInfo.`of(Utf8Entry name, Utf8Entry descriptor, List<Attribute<?>> attributes)`
Returns a record component description.
`static RecordComponentInfo`
RecordComponentInfo.`of(String name, ClassDesc descriptor, List<Attribute<?>> attributes)`
Returns a record component description.