Spec-Zone.ru › OpenJDK 24

Интерфейс Attribute<A extends Attribute<A>>

Параметры типа:
A - тип атрибута
Все суперинтерфейсы:
ClassFileElement
Все известные подинтерфейсы:
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
public 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)
Моделирует атрибут (JVMS 4.7) в формате файла class. Атрибуты существуют в определённых структурах файлов class, моделируемых интерфейсом AttributedElement, который предоставляет базовый доступ для чтения к атрибутам.

Эта иерархия запечатанных интерфейсов включает атрибуты, определённые в JVMS и специфичные для JDK нестандартные атрибуты. Их мапперы доступны в Attributes. Два особых подтипа Attribute являются CustomAttribute, от которого должны наследоваться все пользовательские атрибуты, и UnknownAttribute, представляющий атрибуты, считанные из файла class, но не распознаваемые ClassFile.AttributeMapperOption.

Атрибуты считываются через AttributedElement или обход элементов CompoundElement; они записываются через ClassFileBuilder. Более подробную информацию см. в разделах Чтение атрибутов и Запись атрибутов.

См. Спецификацию виртуальной машины Java:
4.7 Атрибуты
Граф иерархии запечатанного класса:
Sealed class hierarchy graph for AttributeSealed class hierarchy graph for Attribute
С:
24
См. также:
  • java.lang.classfile.attribute
  • AttributeMapper
  • AttributedElement
  • CustomAttribute
  • UnknownAttribute

Краткое описание методов

Модификатор и тип Метод Описание
AttributeMapper<A> attributeMapper()
Возвращает связанный с этим атрибутом AttributeMapper.
Utf8Entry attributeName()
Возвращает имя атрибута.

Подробное описание методов

attributeName

Utf8Entry attributeName()
Возвращает имя атрибута. Строковое значение имени эквивалентно значению attributeMapper().name().

Если этот атрибут считан из файла class, этот метод возвращает Utf8Entry, указывающий имя атрибута в файле class.

Возвращает:
имя атрибута

attributeMapper

AttributeMapper<A> attributeMapper()
Возвращает связанный с этим атрибутом AttributeMapper.
Возвращает:
связанный с этим атрибутом AttributeMapper

© 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://download.java.net/java/early_access/jdk24/docs/api/java.base/java/lang/classfile/Attribute.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API