A builder for building
ModuleDescriptor
objects.
ModuleDescriptor
defines the newModule
, newOpenModule
, and newAutomaticModule
methods to create builders for building normal, open, and automatic modules.
The set of packages in the module are accumulated by the Builder
as the exports
, opens
, packages
, provides
, and mainClass
methods are invoked.
The module names, package names, and class names that are parameters specified to the builder methods are the module names, package names, and qualified names of classes (in named packages) as defined in the The Java™ Language Specification .
Example usage:
ModuleDescriptor descriptor = ModuleDescriptor.newModule("stats.core")
.requires("java.base")
.exports("org.acme.stats.core.clustering")
.exports("org.acme.stats.core.regression")
.packages(Set.of("org.acme.stats.core.internal"))
.build();