インタフェースAnnotation


public sealed interface Annotation
annotation構 (JVMS 4.7.16)または type_annotation構 (JVMS 4.7.20)の一部をモデル化します。 このモデルは、注釈のインタフェースと要 と値のペアのセットを示します。

このモデルは、classファイル内のモデル化された構 のロケーションと注釈インタフェースの定義を考慮して、注釈を再構築できます。

equalsメソッドを使用して、2つのAnnotationオブジェクトを比較する必要があります。

APIのノート:
Javaプログラ の 合、モデル化された構 のロケーションは、再構築された注釈が表示されるソース・コード要 または型(JLS 9.7.4)を示し、注釈インタフェース定義は、再構築された注釈にデフォルト値(JLS 9.6.2)の要 があるかどうか、および再構築された注釈が複数の注釈(JLS 9.7.5)のコンテナ注釈であるかどうかを決定します。
導入されたバージョン:
24
関連 目:
  • メソッドの詳細

    • className

      Utf8Entry className()
      注釈インタフェースの「記述子文字列」を保持する定数プール・エントリを返します。
      戻り値:
      注釈インタフェースの「記述子文字列」を保持する定数プール・エントリ
      関連 目:
    • classSymbol

      default ClassDesc classSymbol()
      注釈インタフェースをシンボリック記述子として返します。
      戻り値:
      シンボリック記述子としての注釈インタフェース
      関連 目:
    • elements

      List<AnnotationElement> elements()
      注釈の要 と値のペアを返します。
      戻り値:
      注釈の要 と値のペア
    • of

      static Annotation of(Utf8Entry annotationClass, List<AnnotationElement> elements)
      注釈を返します。
      パラメータ:
      annotationClass - 注釈インタフェースの記述子文字列を保持する定数プール・エントリ
      elements - 注釈の要 と値のペア
      戻り値:
      注釈
    • of

      static Annotation of(Utf8Entry annotationClass, AnnotationElement... elements)
      注釈を返します。
      パラメータ:
      annotationClass - 注釈インタフェースの記述子文字列を保持する定数プール・エントリ
      elements - 注釈の要 と値のペア
      戻り値:
      注釈
    • of

      static Annotation of(ClassDesc annotationClass, List<AnnotationElement> elements)
      注釈を返します。
      パラメータ:
      annotationClass - 注釈インタフェースの記述子
      elements - 注釈の要 と値のペア
      戻り値:
      注釈
    • of

      static Annotation of(ClassDesc annotationClass, AnnotationElement... elements)
      注釈を返します。
      パラメータ:
      annotationClass - 注釈インタフェースの記述子
      elements - 注釈の要 と値のペア
      戻り値:
      注釈