Interface ModuleAttribute

All Superinterfaces:
Attribute<ModuleAttribute>, ClassElement, ClassfileElement, WritableElement<ModuleAttribute>
All Known Implementing Classes:
BoundAttribute.BoundModuleAttribute, UnboundAttribute.UnboundModuleAttribute

Models the Module attribute , which can appear on classes that represent module descriptors. Delivered as a ClassElement when traversing the elements of a ClassModel.
  • Method Details

    • moduleName

      ModuleEntry moduleName()
      Returns the name of the module.
      Returns:
      the name of the module
    • moduleFlagsMask

      int moduleFlagsMask()
      Returns the the module flags of the module, as a bit mask.
      Returns:
      the the module flags of the module, as a bit mask
    • moduleFlags

      default Set<AccessFlag> moduleFlags()
      Returns the the module flags of the module, as a set of enum constants.
      Returns:
      the the module flags of the module, as a set of enum constants
    • has

      default boolean has(AccessFlag flag)
    • moduleVersion

      Optional<Utf8Entry> moduleVersion()
      Returns version of the module, if present.
      Returns:
      version of the module, if present
    • requires

      List<ModuleRequireInfo> requires()
      Returns the modules required by this module.
      Returns:
      the modules required by this module
    • exports

      Returns the packages exported by this module.
      Returns:
      the packages exported by this module
    • opens

      Returns the packages opened by this module.
      Returns:
      the packages opened by this module
    • uses

      List<ClassEntry> uses()
      Returns the services used by this module. Services may be discovered via ServiceLoader.
      Returns:
      the services used by this module
    • provides

      List<ModuleProvideInfo> provides()
      Returns the service implementations provided by this module.
      Returns:
      the service implementations provided by this module
    • of

      static ModuleAttribute of(ModuleEntry moduleName, int moduleFlags, Utf8Entry moduleVersion, Collection<ModuleRequireInfo> requires, Collection<ModuleExportInfo> exports, Collection<ModuleOpenInfo> opens, Collection<ClassEntry> uses, Collection<ModuleProvideInfo> provides)
      Returns a Module attribute.
      Parameters:
      moduleName - the module name
      moduleFlags - the module flags
      moduleVersion - the module version
      requires - the required packages
      exports - the exported packages
      opens - the opened packages
      uses - the consumed services
      provides - the provided services
      Returns:
      a Module attribute
    • of

      Returns a Module attribute.
      Parameters:
      moduleName - the module name
      attrHandler - a handler that receives a ModuleAttribute.ModuleAttributeBuilder
      Returns:
      a Module attribute