- All Superinterfaces:
Attribute<ModuleAttribute>,ClassElement,ClassfileElement,WritableElement<ModuleAttribute>
- All Known Implementing Classes:
BoundAttribute.BoundModuleAttribute,UnboundAttribute.UnboundModuleAttribute
public sealed interface ModuleAttribute
extends Attribute<ModuleAttribute>, ClassElement
permits 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.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionexports()Returns the packages exported by this module.default booleanhas(AccessFlag flag) default Set<AccessFlag>Returns the the module flags of the module, as a set of enum constants.intReturns the the module flags of the module, as a bit mask.Returns the name of the module.Returns version of the module, if present.static ModuleAttributeof(ModuleEntry moduleName, int moduleFlags, Utf8Entry moduleVersion, Collection<ModuleRequireInfo> requires, Collection<ModuleExportInfo> exports, Collection<ModuleOpenInfo> opens, Collection<ClassEntry> uses, Collection<ModuleProvideInfo> provides) Returns aModuleattribute.static ModuleAttributeof(ModuleDesc moduleName, Consumer<ModuleAttribute.ModuleAttributeBuilder> attrHandler) Returns aModuleattribute.opens()Returns the packages opened by this module.provides()Returns the service implementations provided by this module.requires()Returns the modules required by this module.uses()Returns the services used by this module.Methods inherited from interface org.glavo.classfile.Attribute
attributeMapper, attributeNameMethods inherited from interface org.glavo.classfile.WritableElement
writeTo
-
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
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
-
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
List<ModuleExportInfo> exports()Returns the packages exported by this module.- Returns:
- the packages exported by this module
-
opens
List<ModuleOpenInfo> 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 viaServiceLoader.- 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 aModuleattribute.- Parameters:
moduleName- the module namemoduleFlags- the module flagsmoduleVersion- the module versionrequires- the required packagesexports- the exported packagesopens- the opened packagesuses- the consumed servicesprovides- the provided services- Returns:
- a
Moduleattribute
-
of
static ModuleAttribute of(ModuleDesc moduleName, Consumer<ModuleAttribute.ModuleAttributeBuilder> attrHandler) Returns aModuleattribute.- Parameters:
moduleName- the module nameattrHandler- a handler that receives aModuleAttribute.ModuleAttributeBuilder- Returns:
- a
Moduleattribute
-