インタフェースModuleTargetAttribute
- すべてのスーパー・インタフェース:
AttributePREVIEW<ModuleTargetAttributePREVIEW>,ClassElementPREVIEW,ClassFileElementPREVIEW,WritableElementPREVIEW<ModuleTargetAttributePREVIEW>
public sealed interface ModuleTargetAttribute extends AttributePREVIEW<ModuleTargetAttributePREVIEW>, ClassElementPREVIEW
ModuleTargetAttributeは、JavaプラットフォームのプレビューAPIです。
プレビュー機能は、今後のリリースで削除するか、Javaプラットフォームの永続機能にアップグレードすることができます。
モジュール記述子を表すクラスに指定できる
ModuleTarget属性をモデル化します。 これは、ターゲット・プラットフォームの制約を取得するJDK固有の属性です。 ClassModelPREVIEWの要素をトラバースするときに、ClassElementPREVIEWとして提供されます。
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;
}
この属性は、特定のロケーションにある複数のインスタンスを許可しません。 属性の後続の出現は、属性要素の作成時または変換時に優先されます。
- 導入されたバージョン:
- 22
-
メソッドのサマリー
修飾子と型メソッド説明static ModuleTargetAttributePREVIEWModuleTarget属性を返します。static ModuleTargetAttributePREVIEWModuleTarget属性を返します。ターゲット・プラットフォームを返します。インタフェースjava.lang.classfile.AttributePREVIEWで宣言されたメソッド
attributeMapper, attributeNameインタフェースjava.lang.classfile.WritableElementPREVIEWで宣言されたメソッド
writeTo
-
メソッドの詳細
-
targetPlatform
-
of
static ModuleTargetAttributePREVIEW of(String targetPlatform) ModuleTarget属性を返します。- パラメータ:
targetPlatform- ターゲット・プラットフォーム- 戻り値:
ModuleTarget属性
-
of
static ModuleTargetAttributePREVIEW of(Utf8EntryPREVIEW targetPlatform) ModuleTarget属性を返します。- パラメータ:
targetPlatform- ターゲット・プラットフォーム- 戻り値:
ModuleTarget属性
-
ModuleTargetAttributeを使用できます。