インタフェースAttributedElement

すべてのスーパー・インタフェース:
ClassFileElementPREVIEW
既知のすべてのサブインタフェース:
ClassModelPREVIEW, CodeAttributePREVIEW, CodeModelPREVIEW, FieldModelPREVIEW, MethodModelPREVIEW, RecordComponentInfoPREVIEW

public sealed interface AttributedElement extends ClassFileElementPREVIEW permits ClassModelPREVIEW, CodeModelPREVIEW, FieldModelPREVIEW, MethodModelPREVIEW, RecordComponentInfoPREVIEW (not exhaustive)
AttributedElementは、JavaプラットフォームのプレビューAPIです。
プレビュー機能が有効な場合のみ、プログラムでAttributedElementを使用できます。
プレビュー機能は、今後のリリースで削除するか、Javaプラットフォームの永続機能にアップグレードすることができます。
クラス、フィールド、メソッド、コード属性、レコード・コンポーネントなどの属性を持つエンティティを記述するClassFileElementPREVIEW
シール済クラス階層グラフ:
AttributedElementのシール済クラス階層グラフAttributedElementのシール済クラス階層グラフ
導入されたバージョン:
22
  • メソッドの詳細

    • attributes

      List<AttributePREVIEW<?>> attributes()
      この要素の属性を返します。
      戻り値:
      この要素の属性
    • findAttribute

      default <T extends AttributePREVIEW<T>> Optional<T> findAttribute(AttributeMapperPREVIEW<T> attr)
      名前で属性を検索します。
      型パラメータ:
      T - 属性の型
      パラメータ:
      attr - 属性マッパー
      戻り値:
      属性、または属性が存在しない場合は空のOptional
    • findAttributes

      default <T extends AttributePREVIEW<T>> List<T> findAttributes(AttributeMapperPREVIEW<T> attr)
      名前で1つ以上の属性を検索します。
      型パラメータ:
      T - 属性の型
      パラメータ:
      attr - 属性マッパー
      戻り値:
      属性、または属性が存在しない場合は空のList