モジュール java.base

インタフェースModuleHashesAttribute

すべてのスーパー・インタフェース:
AttributePREVIEW<ModuleHashesAttributePREVIEW>, ClassElementPREVIEW, ClassFileElementPREVIEW, WritableElementPREVIEW<ModuleHashesAttributePREVIEW>

public sealed interface ModuleHashesAttribute extends AttributePREVIEW<ModuleHashesAttributePREVIEW>, ClassElementPREVIEW
ModuleHashesAttributeは、JavaプラットフォームのプレビューAPIです。
プレビュー機能が有効な場合のみ、プログラムでModuleHashesAttributeを使用できます。
プレビュー機能は、今後のリリースで削除するか、Javaプラットフォームの永続機能にアップグレードすることができます。
モジュール記述子を表すクラスに指定できるModuleHashes属性をモデル化します。 これはJDK固有の属性で、一連の共通提供モジュールのハッシュを取得します。 ClassModelPREVIEWの要素をトラバースするときに、ClassElementPREVIEWとして提供されます。

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];

 }
  

この属性は、特定のロケーションにある複数のインスタンスを許可しません。 属性の後続の出現は、属性要素の作成時または変換時に優先されます。

導入されたバージョン:
22