インタフェースModuleTargetAttribute

すべてのスーパー・インタフェース:
Attribute<ModuleTargetAttribute>, ClassElement, ClassFileElement

public sealed interface ModuleTargetAttribute extends Attribute<ModuleTargetAttribute>, ClassElement
ModuleTarget属性をモデル化します。この属性は、ターゲット・プラットフォームの制約を表すために、モジュール記述子「表す」のクラスに指定できます。

ModuleTarget属性の指定は次のとおりです。

 
 TargetPlatform_attribute {
   // index to CONSTANT_utf8_info structure in constant pool representing
   // the string "ModuleTarget"
   u2 attribute_name_index;
   u4 attribute_length;

   // index to CONSTANT_utf8_info structure with the target platform
   u2 target_platform_index;
 }
  

この属性はクラスにのみ表示され、クラス内の「複数のインスタンス」は許可されません。 「定数プール」へのデータ依存性があります。

この属性は、Java SEプラットフォームでは事前定義されていません。 これは、jlinkおよびjmodツールを定義するjdk.jlinkモジュールによって生成されるJDK固有の非標準属性です。

導入されたバージョン:
24
関連項目:
  • メソッドの詳細

    • targetPlatform

      Utf8Entry targetPlatform()
      ターゲット・プラットフォームを返します。
      戻り値:
      ターゲット・プラットフォーム
    • of

      static ModuleTargetAttribute of(String targetPlatform)
      ModuleTarget属性を返します。
      パラメータ:
      targetPlatform - ターゲット・プラットフォーム
      戻り値:
      ModuleTarget属性
    • of

      static ModuleTargetAttribute of(Utf8Entry targetPlatform)
      ModuleTarget属性を返します。
      パラメータ:
      targetPlatform - ターゲット・プラットフォーム
      戻り値:
      ModuleTarget属性