インタフェースModuleHashesAttribute

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

public sealed interface ModuleHashesAttribute extends Attribute<ModuleHashesAttribute>, ClassElement
ModuleHashes属性をモデル化します。この属性は、モジュール記述子を「表す」クラス上に表示され、一連の共通配信モジュールのハッシュを取得します。

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

 

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

   // index to CONSTANT_utf8_info structure with algorithm name
   u2 algorithm_index;

   // the number of entries in the hashes table
   u2 hashes_count;
   {   u2 module_name_index (index to CONSTANT_Module_info structure)
       u2 hash_length;
       u1 hash[hash_length];
   } hashes[hashes_count];

 }
  

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

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

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

    • algorithm

      Utf8Entry algorithm()
      ハッシュのコンピュートに使用されるアルゴリズム名を返します。
      戻り値:
      ハッシュのコンピュートに使用されるアルゴリズム名
    • hashes

      List<ModuleHashInfo> hashes()
      関連モジュールに関するハッシュ情報を返します。
      戻り値:
      関連モジュールに関するハッシュ情報
    • of

      static ModuleHashesAttribute of(String algorithm, List<ModuleHashInfo> hashes)
      ModuleHashes属性を返します。
      パラメータ:
      algorithm - ハッシュ・アルゴリズム
      hashes - ハッシュの説明
      戻り値:
      ModuleHashes属性
    • of

      static ModuleHashesAttribute of(String algorithm, ModuleHashInfo... hashes)
      ModuleHashes属性を返します。
      パラメータ:
      algorithm - ハッシュ・アルゴリズム
      hashes - ハッシュの説明
      戻り値:
      ModuleHashes属性
    • of

      static ModuleHashesAttribute of(Utf8Entry algorithm, List<ModuleHashInfo> hashes)
      ModuleHashes属性を返します。
      パラメータ:
      algorithm - ハッシュ・アルゴリズム
      hashes - ハッシュの説明
      戻り値:
      ModuleHashes属性
    • of

      static ModuleHashesAttribute of(Utf8Entry algorithm, ModuleHashInfo... hashes)
      ModuleHashes属性を返します。
      パラメータ:
      algorithm - ハッシュ・アルゴリズム
      hashes - ハッシュの説明
      戻り値:
      ModuleHashes属性