クラスCustomAttribute<T extends CustomAttribute<T>>
java.lang.Object
java.lang.classfile.CustomAttribute<T>
- 型パラメータ:
T- カスタム属性タイプ
- すべての実装されたインタフェース:
Attribute<T>,ClassElement,ClassFileElement,CodeElement,FieldElement,MethodElement
public abstract non-sealed class CustomAttribute<T extends CustomAttribute<T>> extends Object implements Attribute<T>, CodeElement, ClassElement, MethodElement, FieldElement
classファイル内のユーザー定義属性をモデル化します。 ユーザー定義属性のAPIモデルでは、このクラスを拡張する必要があります。 ユーザー定義属性には、attributeMapper()によって返され、ユーザー定義属性を読み取ることができるようにClassFile.AttributeMapperOptionに登録されるAttributeMapperも定義する必要があります。
現在、ユーザー定義属性は、CodeModelのトラバーサルでは配信されません。
classファイルから読み取られたユーザー定義属性のアクセッサ・メソッドでは、属性モデルが遅延評価され、評価で属性の不正なclassファイル形式が検出されると、IllegalArgumentExceptionがスローされる場合があります。
- 導入されたバージョン:
- 24
- 関連項目:
-
コンストラクタのサマリー
コンストラクタ -
メソッドのサマリー
-
コンストラクタの詳細
-
CustomAttribute
-
-
メソッドの詳細
-
attributeMapper
public final AttributeMapper<T> attributeMapper()インタフェースからコピーされた説明:Attributeこの属性に関連付けられたAttributeMapperを返します。- 定義:
- インタフェース
Attribute<T extends CustomAttribute<T>>内のattributeMapper - 戻り値:
- この属性に関連付けられた
AttributeMapper
-
attributeName
public Utf8Entry attributeName()属性の名前を返します。 名前の「文字列値」は、attributeMapper().name()の値と同等です。この属性が
classファイルから読み取られると、このメソッドはclassファイル内の属性名を示すUtf8Entryを返します。- 定義:
- インタフェース
Attribute<T extends CustomAttribute<T>>内のattributeName - 実装要件:
- デフォルトの実装では、書込みのみに適した
Utf8Entry(「バインドなし」かのしれない)が返されます。classファイルから読み取られた属性を表すサブクラスは、このメソッドをオーバーライドする必要があります。 - 戻り値:
- 属性の名前
- 関連項目:
-