Top Description Methods
java.lang.classfile

public sealed Interface Attribute<A extends Attribute<A>>

extends WritableElement<A extends Attribute<A>>
Known Direct Subinterfaces
java.lang.classfile.attribute.AnnotationDefaultAttribute, java.lang.classfile.attribute.BootstrapMethodsAttribute, java.lang.classfile.attribute.CharacterRangeTableAttribute, java.lang.classfile.attribute.CodeAttribute, java.lang.classfile.attribute.CompilationIDAttribute, java.lang.classfile.attribute.ConstantValueAttribute, java.lang.classfile.attribute.DeprecatedAttribute, java.lang.classfile.attribute.EnclosingMethodAttribute, java.lang.classfile.attribute.ExceptionsAttribute, java.lang.classfile.attribute.InnerClassesAttribute, java.lang.classfile.attribute.LineNumberTableAttribute, java.lang.classfile.attribute.LocalVariableTableAttribute, java.lang.classfile.attribute.LocalVariableTypeTableAttribute, java.lang.classfile.attribute.MethodParametersAttribute, java.lang.classfile.attribute.ModuleAttribute, java.lang.classfile.attribute.ModuleHashesAttribute, java.lang.classfile.attribute.ModuleMainClassAttribute, java.lang.classfile.attribute.ModulePackagesAttribute, java.lang.classfile.attribute.ModuleResolutionAttribute, java.lang.classfile.attribute.ModuleTargetAttribute, java.lang.classfile.attribute.NestHostAttribute, java.lang.classfile.attribute.NestMembersAttribute, java.lang.classfile.attribute.PermittedSubclassesAttribute, java.lang.classfile.attribute.RecordAttribute, java.lang.classfile.attribute.RuntimeInvisibleAnnotationsAttribute, java.lang.classfile.attribute.RuntimeInvisibleParameterAnnotationsAttribute, java.lang.classfile.attribute.RuntimeInvisibleTypeAnnotationsAttribute, java.lang.classfile.attribute.RuntimeVisibleAnnotationsAttribute, java.lang.classfile.attribute.RuntimeVisibleParameterAnnotationsAttribute, java.lang.classfile.attribute.RuntimeVisibleTypeAnnotationsAttribute, java.lang.classfile.attribute.SignatureAttribute, java.lang.classfile.attribute.SourceDebugExtensionAttribute, java.lang.classfile.attribute.SourceFileAttribute, java.lang.classfile.attribute.SourceIDAttribute, java.lang.classfile.attribute.StackMapTableAttribute, java.lang.classfile.attribute.SyntheticAttribute, java.lang.classfile.attribute.UnknownAttribute
Known Direct Implementers
java.lang.classfile.CustomAttribute, jdk.internal.classfile.impl.BoundAttribute, jdk.internal.classfile.impl.UnboundAttribute
Annotations
@PreviewFeature
feature:CLASSFILE_API
Type Parameters
<A>
the attribute type
Imports
java.lang.classfile.attribute.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, jdk.internal.classfile.impl.BoundAttribute, .UnboundAttribute, jdk.internal.javac.PreviewFeature

Preview

Second Preview of ClassFile API (JEP 466).

Programs can only use Attribute when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.

Models a classfile attribute 4.7. Many, though not all, subtypes of Attribute will implement ClassElement, MethodElement, FieldElement, or CodeElement; attributes that are also elements will be delivered when traversing the elements of the corresponding model type. Additionally, all attributes are accessible directly from the corresponding model type through AttributedElement#findAttribute(AttributeMapper).
Since
22

Method Summary

Modifier and TypeMethod and Description
public AttributeMapper<A>

Returns:

the AttributeMapper associated with this attribute
attributeMapper
()

Returns the AttributeMapper associated with this attribute.

public String

Returns:

the name of the attribute
attributeName
()

Returns the name of the attribute.

Inherited from java.lang.classfile.WritableElement:
writeTo

Method Detail

attributeMapperback to summary
public AttributeMapper<A> attributeMapper()

Returns the AttributeMapper associated with this attribute.

Returns:AttributeMapper<A>

the AttributeMapper associated with this attribute

attributeNameback to summary
public String attributeName()

Returns the name of the attribute.

Returns:String

the name of the attribute