Интерфейс 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)
class. Атрибуты существуют в определённых структурах файлов class, моделируемых интерфейсом AttributedElement, который предоставляет базовый доступ для чтения к атрибутам. Эта иерархия запечатанных интерфейсов включает атрибуты, определённые в JVMS и специфичные для JDK нестандартные атрибуты. Их мапперы доступны в Attributes. Два особых подтипа
Attribute являются CustomAttribute, от которого должны наследоваться все пользовательские атрибуты, и UnknownAttribute, представляющий атрибуты, считанные из файла class, но не распознаваемые ClassFile.AttributeMapperOption.
Атрибуты считываются через AttributedElement или обход элементов CompoundElement; они записываются через ClassFileBuilder. Более подробную информацию см. в разделах Чтение атрибутов и Запись атрибутов.
- См. Спецификацию виртуальной машины Java:
- 4.7 Атрибуты
- Граф иерархии запечатанного класса:
- С:
- 24
- См. также:
Краткое описание методов
| Модификатор и тип | Метод | Описание |
|---|---|---|
AttributeMapper |
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