ModuleDescriptor (Java SE 9 & JDK 9 ) (original) (raw)


public class ModuleDescriptor
extends Object
implements Comparable<ModuleDescriptor>
A module descriptor.
A module descriptor describes a named module and defines methods to obtain each of its components. The module descriptor for a named module in the Java virtual machine is obtained by invoking the Module's getDescriptor method. Module descriptors can also be created using theModuleDescriptor.Builder class or by reading the binary form of a module declaration (module-info.class) using the read methods defined here.
A module descriptor describes a normal, open, or automatic module. Normal modules and open modules describe their dependences, exported-packages, the services that they use or provide, and other components. Normal modules may open specific packages. The module descriptor for an open modules does not declare any open packages (its opens method returns an empty set) but when instantiated in the Java virtual machine then it is treated as if all packages are open. The module descriptor for an automatic module does not declare any dependences (except for the mandatory dependency on java.base), and does not declare any exported or open packages. Automatic module receive special treatment during resolution so that they read all other modules in the configuration. When an automatic module is instantiated in the Java virtual machine then it reads every unnamed module and is treated as if all packages are exported and open.
ModuleDescriptor objects are immutable and safe for use by multiple concurrent threads.
Since:
9
See Also:
Module

Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2017, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.