インタフェースModuleRequireInfo


public sealed interface ModuleRequireInfo
ModuleRequireInfoは、JavaプラットフォームのプレビューAPIです。
プレビュー機能が有効な場合のみ、プログラムでModuleRequireInfoを使用できます。
プレビュー機能は、今後のリリースで削除するか、Javaプラットフォームの永続機能にアップグレードすることができます。
ModuleAttributePREVIEWの単一の"requires"宣言をモデル化します。
導入されたバージョン:
22
  • メソッドの詳細

    • requires

      ModuleEntryPREVIEW requires()
      現在のモジュールが依存するモジュールを返します。
      戻り値:
      現在のモジュールが依存するモジュール
    • requiresFlagsMask

      int requiresFlagsMask()
      このrequire宣言に関連付けられているフラグをビット・マスクとして返します。 有効なフラグには、ClassFile.ACC_TRANSITIVEPREVIEWClassFile.ACC_STATIC_PHASEPREVIEWClassFile.ACC_SYNTHETICPREVIEWおよびClassFile.ACC_MANDATEDPREVIEWがあります
      戻り値:
      これに関連付けられたフラグは、ビット・マスクとして宣言を必要とします。
    • requiresFlags

      default Set<AccessFlag> requiresFlags()
      アクセス・フラグを返します。
      戻り値:
      アクセス・フラグ
    • requiresVersion

      Optional<Utf8EntryPREVIEW> requiresVersion()
      必要なモジュールが存在する場合は、必要なバージョンを返します。
      戻り値:
      必要なモジュール(存在する場合)の必要なバージョン
    • has

      default boolean has(AccessFlag flag)
      特定のアクセス・フラグが設定されているかどうかを返します。
      パラメータ:
      flag - アクセス・フラグ
      戻り値:
      特定のアクセス・フラグが設定されているかどうか
    • of

      static ModuleRequireInfoPREVIEW of(ModuleEntryPREVIEW requires, int requiresFlags, Utf8EntryPREVIEW requiresVersion)
      モジュール要件の説明を返します。
      パラメータ:
      requires - 必要なモジュール
      requiresFlags - 必須フラグ
      requiresVersion - 必要なバージョン
      戻り値:
      モジュール要件の説明
    • of

      static ModuleRequireInfoPREVIEW of(ModuleEntryPREVIEW requires, Collection<AccessFlag> requiresFlags, Utf8EntryPREVIEW requiresVersion)
      モジュール要件の説明を返します。
      パラメータ:
      requires - 必要なモジュール
      requiresFlags - 必須フラグ
      requiresVersion - 必要なバージョン
      戻り値:
      モジュール要件の説明
    • of

      static ModuleRequireInfoPREVIEW of(ModuleDesc requires, int requiresFlags, String requiresVersion)
      モジュール要件の説明を返します。
      パラメータ:
      requires - 必要なモジュール
      requiresFlags - 必須フラグ
      requiresVersion - 必要なバージョン
      戻り値:
      モジュール要件の説明
    • of

      static ModuleRequireInfoPREVIEW of(ModuleDesc requires, Collection<AccessFlag> requiresFlags, String requiresVersion)
      モジュール要件の説明を返します。
      パラメータ:
      requires - 必要なモジュール
      requiresFlags - 必須フラグ
      requiresVersion - 必要なバージョン
      戻り値:
      モジュール要件の説明