インタフェースModuleAttribute
- すべてのスーパー・インタフェース:
AttributePREVIEW<ModuleAttributePREVIEW>
,ClassElementPREVIEW
,ClassFileElementPREVIEW
,WritableElementPREVIEW<ModuleAttributePREVIEW>
public sealed interface ModuleAttribute extends AttributePREVIEW<ModuleAttributePREVIEW>, ClassElementPREVIEW
ModuleAttribute
は、JavaプラットフォームのプレビューAPIです。
プレビュー機能は、今後のリリースで削除するか、Javaプラットフォームの永続機能にアップグレードすることができます。
Module
属性4.7.25をモデル化します。これは、モジュール記述子を表すクラスに指定できます。 ClassModel
PREVIEWの要素をトラバースするときに、ClassElement
PREVIEWとして提供されます。
この属性は、特定のロケーションにある複数のインスタンスを許可しません。 属性の後続の出現は、属性要素の作成時または変換時に優先されます。
この属性は、Java SE Platformバージョン9で導入されました。
- 導入されたバージョン:
- 22
-
ネストされたクラスのサマリー
ネストされたクラス修飾子と型インタフェース説明static interface
Preview.モジュール属性のビルダー。 -
メソッドのサマリー
修飾子と型メソッド説明exports()
このモジュールによってエクスポートされたパッケージを返します。default boolean
has
(AccessFlag flag) モジュール・フラグの存在をテストしますdefault Set
<AccessFlag> モジュールのモジュール・フラグを列挙定数のセットとして返します。int
モジュールのモジュール・フラグをビット・マスクとして返します。モジュールの名前を返します。モジュールのバージョンを返します(存在する場合)。static ModuleAttributePREVIEW
of
(ModuleEntryPREVIEW moduleName, int moduleFlags, Utf8EntryPREVIEW moduleVersion, Collection<ModuleRequireInfoPREVIEW> requires, Collection<ModuleExportInfoPREVIEW> exports, Collection<ModuleOpenInfoPREVIEW> opens, Collection<ClassEntryPREVIEW> uses, Collection<ModuleProvideInfoPREVIEW> provides) Module
属性を返します。static ModuleAttributePREVIEW
of
(ModuleEntryPREVIEW moduleName, Consumer<ModuleAttribute.ModuleAttributeBuilderPREVIEW> attrHandler) Module
属性を返します。static ModuleAttributePREVIEW
of
(ModuleDesc moduleName, Consumer<ModuleAttribute.ModuleAttributeBuilderPREVIEW> attrHandler) Module
属性を返します。opens()
このモジュールによって開かれたパッケージを返します。provides()
このモジュールによって提供されるサービス実装を返します。requires()
このモジュールに必要なモジュールを返します。uses()
このモジュールで使用されるサービスを返します。インタフェースjava.lang.classfile.AttributePREVIEWで宣言されたメソッド
attributeMapper, attributeName
インタフェースjava.lang.classfile.WritableElementPREVIEWで宣言されたメソッド
writeTo
-
メソッドの詳細
-
moduleName
-
moduleFlagsMask
int moduleFlagsMask()モジュールのモジュール・フラグをビット・マスクとして返します。- 戻り値:
- モジュールのモジュール・フラグをビット・マスクとして
-
moduleFlags
default Set<AccessFlag> moduleFlags()モジュールのモジュール・フラグを列挙定数のセットとして返します。- 戻り値:
- 列挙定数のセットとして、モジュールのモジュール・フラグ
-
has
default boolean has(AccessFlag flag) モジュール・フラグの存在をテストします- パラメータ:
flag
- モジュール・フラグ- 戻り値:
- フラグが設定されている場合はtrue
-
moduleVersion
-
requires
-
exports
List<ModuleExportInfoPREVIEW> exports()このモジュールによってエクスポートされたパッケージを返します。- 戻り値:
- このモジュールによってエクスポートされたパッケージ
-
opens
-
uses
List<ClassEntryPREVIEW> uses()このモジュールで使用されるサービスを返します。 サービスは、ServiceLoader
で検出できます。- 戻り値:
- このモジュールで使用されるサービス
-
provides
-
of
static ModuleAttributePREVIEW of(ModuleEntryPREVIEW moduleName, int moduleFlags, Utf8EntryPREVIEW moduleVersion, Collection<ModuleRequireInfoPREVIEW> requires, Collection<ModuleExportInfoPREVIEW> exports, Collection<ModuleOpenInfoPREVIEW> opens, Collection<ClassEntryPREVIEW> uses, Collection<ModuleProvideInfoPREVIEW> provides) Module
属性を返します。- パラメータ:
moduleName
- モジュール名moduleFlags
- モジュール・フラグmoduleVersion
- モジュールのバージョンrequires
- 必要なパッケージexports
- エクスポートされたパッケージopens
- 開いたパッケージuses
- 消費されたサービスprovides
- 提供されたサービス- 戻り値:
Module
属性
-
of
static ModuleAttributePREVIEW of(ModuleDesc moduleName, Consumer<ModuleAttribute.ModuleAttributeBuilderPREVIEW> attrHandler) Module
属性を返します。- パラメータ:
moduleName
- モジュール名attrHandler
-ModuleAttribute.ModuleAttributeBuilder
PREVIEWを受け取るハンドラ- 戻り値:
Module
属性
-
of
static ModuleAttributePREVIEW of(ModuleEntryPREVIEW moduleName, Consumer<ModuleAttribute.ModuleAttributeBuilderPREVIEW> attrHandler) Module
属性を返します。- パラメータ:
moduleName
- モジュール名attrHandler
-ModuleAttribute.ModuleAttributeBuilder
PREVIEWを受け取るハンドラ- 戻り値:
Module
属性
-
ModuleAttribute
を使用できます。