public sealed interface ModuleOpenInfo
ModuleOpenInfo
is a preview API of the Java platform.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
Models a single "opens" declaration in the
ModuleAttribute
PREVIEW.- Since:
- 22
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
has
(AccessFlag flag) Returns whether the specified access flag is set.static ModuleOpenInfoPREVIEW
of
(PackageEntryPREVIEW opens, int opensFlags, ModuleEntryPREVIEW... opensTo) Returns a module open description.static ModuleOpenInfoPREVIEW
of
(PackageEntryPREVIEW opens, int opensFlags, List<ModuleEntryPREVIEW> opensTo) Returns a module open description.static ModuleOpenInfoPREVIEW
of
(PackageEntryPREVIEW opens, Collection<AccessFlag> opensFlags, ModuleEntryPREVIEW... opensTo) Returns a module open description.static ModuleOpenInfoPREVIEW
of
(PackageEntryPREVIEW opens, Collection<AccessFlag> opensFlags, List<ModuleEntryPREVIEW> opensTo) Returns a module open description.static ModuleOpenInfoPREVIEW
of
(PackageDesc opens, int opensFlags, ModuleDesc... opensTo) Returns a module open description.static ModuleOpenInfoPREVIEW
of
(PackageDesc opens, int opensFlags, List<ModuleDesc> opensTo) Returns a module open description.static ModuleOpenInfoPREVIEW
of
(PackageDesc opens, Collection<AccessFlag> opensFlags, ModuleDesc... opensTo) Returns a module open description.static ModuleOpenInfoPREVIEW
of
(PackageDesc opens, Collection<AccessFlag> opensFlags, List<ModuleDesc> opensTo) Returns a module open description.Returns the package being opened.default Set
<AccessFlag> Returns the access flags.int
Returns the flags associated with this open declaration, as a bit mask.opensTo()
The list of modules to which this package is opened, if it is a qualified open.
-
Method Details
-
openedPackage
PackageEntryPREVIEW openedPackage()Returns the package being opened.- Returns:
- the package being opened
-
opensFlagsMask
int opensFlagsMask()Returns the flags associated with this open declaration, as a bit mask. Valid flags includeClassFile.ACC_SYNTHETIC
PREVIEW andClassFile.ACC_MANDATED
PREVIEW- Returns:
- the flags associated with this open declaration, as a bit mask
-
opensFlags
-
has
Returns whether the specified access flag is set.- Parameters:
flag
- the access flag- Returns:
- whether the specified access flag is set
-
opensTo
List<ModuleEntryPREVIEW> opensTo()The list of modules to which this package is opened, if it is a qualified open.- Returns:
- the modules to which this package is opened
-
of
static ModuleOpenInfoPREVIEW of(PackageEntryPREVIEW opens, int opensFlags, List<ModuleEntryPREVIEW> opensTo) Returns a module open description.- Parameters:
opens
- the package to openopensFlags
- the open flagsopensTo
- the packages to which this package is opened, if it is a qualified open- Returns:
- a module open description
-
of
static ModuleOpenInfoPREVIEW of(PackageEntryPREVIEW opens, Collection<AccessFlag> opensFlags, List<ModuleEntryPREVIEW> opensTo) Returns a module open description.- Parameters:
opens
- the package to openopensFlags
- the open flagsopensTo
- the packages to which this package is opened, if it is a qualified open- Returns:
- a module open description
-
of
static ModuleOpenInfoPREVIEW of(PackageEntryPREVIEW opens, int opensFlags, ModuleEntryPREVIEW... opensTo) Returns a module open description.- Parameters:
opens
- the package to openopensFlags
- the open flagsopensTo
- the packages to which this package is opened, if it is a qualified open- Returns:
- a module open description
-
of
static ModuleOpenInfoPREVIEW of(PackageEntryPREVIEW opens, Collection<AccessFlag> opensFlags, ModuleEntryPREVIEW... opensTo) Returns a module open description.- Parameters:
opens
- the package to openopensFlags
- the open flagsopensTo
- the packages to which this package is opened, if it is a qualified open- Returns:
- a module open description
-
of
Returns a module open description.- Parameters:
opens
- the package to openopensFlags
- the open flagsopensTo
- the packages to which this package is opened, if it is a qualified open- Returns:
- a module open description
-
of
static ModuleOpenInfoPREVIEW of(PackageDesc opens, Collection<AccessFlag> opensFlags, List<ModuleDesc> opensTo) Returns a module open description.- Parameters:
opens
- the package to openopensFlags
- the open flagsopensTo
- the packages to which this package is opened, if it is a qualified open- Returns:
- a module open description
-
of
Returns a module open description.- Parameters:
opens
- the package to openopensFlags
- the open flagsopensTo
- the packages to which this package is opened, if it is a qualified open- Returns:
- a module open description
-
of
static ModuleOpenInfoPREVIEW of(PackageDesc opens, Collection<AccessFlag> opensFlags, ModuleDesc... opensTo) Returns a module open description.- Parameters:
opens
- the package to openopensFlags
- the open flagsopensTo
- the packages to which this package is opened, if it is a qualified open- Returns:
- a module open description
-
ModuleOpenInfo
when preview features are enabled.