Interface ModuleOpenInfo


public sealed interface ModuleOpenInfo
ModuleOpenInfo is a preview API of the Java platform.
Programs can only use ModuleOpenInfo when preview features are enabled.
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 ModuleAttributePREVIEW.
Since:
22
  • 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 include ClassFile.ACC_SYNTHETICPREVIEW and ClassFile.ACC_MANDATEDPREVIEW
      Returns:
      the flags associated with this open declaration, as a bit mask
    • opensFlags

      default Set<AccessFlag> opensFlags()
      Returns the access flags.
      Returns:
      the access flags
    • has

      default boolean has(AccessFlag flag)
      Returns whether the specified access flag is set.
      Parameters:
      flag - the access flag
      Returns:
      whether the specified access flag is set
    • 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 open
      opensFlags - the open flags
      opensTo - 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 open
      opensFlags - the open flags
      opensTo - 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 open
      opensFlags - the open flags
      opensTo - 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 open
      opensFlags - the open flags
      opensTo - 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, int opensFlags, List<ModuleDesc> opensTo)
      Returns a module open description.
      Parameters:
      opens - the package to open
      opensFlags - the open flags
      opensTo - 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 open
      opensFlags - the open flags
      opensTo - 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, int opensFlags, ModuleDesc... opensTo)
      Returns a module open description.
      Parameters:
      opens - the package to open
      opensFlags - the open flags
      opensTo - 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 open
      opensFlags - the open flags
      opensTo - the packages to which this package is opened, if it is a qualified open
      Returns:
      a module open description