Uses of Class
java.lang.Module
Packages that useModule Package Description java.lang Provides classes that are fundamental to the design of the Java programming language.java.lang.instrument Provides services that allow Java programming language agents to instrument programs running on the JVM.java.util Contains the collections framework, some internationalization support classes, a service loader, properties, random number generation, string parsing and scanning classes, base64 encoding and decoding, a bit array, and several miscellaneous utility classes.Uses ofModule injava.lang
Methods injava.lang that returnModule Modifier and Type Method Description Module
Module. addExports(String pn,Module other)
If the caller's module is this module then update this module to export the given package to the given module.Module
Module. addOpens(String pn,Module other)
If this module hasopened a package to at least the caller module then update this module to open the package to the given module.Module
Module. addReads(Module other)
If the caller's module is this module then update this module to read the given module.Module
Module. addUses(Class<?> service)
If the caller's module is this module then update this module to add a service dependence on the given service type.Module
Class. getModule()
Returns the module that this class or interface is a member of.Module
ClassLoader. getUnnamedModule()
Returns the unnamedModule
for this class loader.Methods injava.lang that return types with arguments of typeModule Modifier and Type Method Description Optional<Module>
ModuleLayer. findModule(String name)
Returns the module with the given name in this layer, or if not in this layer, theparent layers.Set<Module>
ModuleLayer. modules()
Returns the set of the modules in this layer.Methods injava.lang with parameters of typeModule Modifier and Type Method Description Module
Module. addExports(String pn,Module other)
If the caller's module is this module then update this module to export the given package to the given module.ModuleLayer.Controller
ModuleLayer.Controller. addExports(Module source,String pn,Module target)
Updates modulesource
in the layer to export a package to moduletarget
.Module
Module. addOpens(String pn,Module other)
If this module hasopened a package to at least the caller module then update this module to open the package to the given module.ModuleLayer.Controller
ModuleLayer.Controller. addOpens(Module source,String pn,Module target)
Updates modulesource
in the layer to open a package to moduletarget
.Module
Module. addReads(Module other)
If the caller's module is this module then update this module to read the given module.ModuleLayer.Controller
ModuleLayer.Controller. addReads(Module source,Module target)
Updates modulesource
in the layer to read moduletarget
.boolean
Module. canRead(Module other)
Indicates if this module reads the given module.staticClass<?>
Class. forName(Module module,String name)
Returns theClass
with the given binary name in the given module.System.Logger
System.LoggerFinder. getLocalizedLogger(String name,ResourceBundle bundle,Module module)
Returns a localizable instance ofLogger
for the givenmodule
.abstractSystem.Logger
System.LoggerFinder. getLogger(String name,Module module)
Returns an instance ofLogger
for the givenmodule
.boolean
Module. isExported(String pn,Module other)
Returnstrue
if this module exports the given package to at least the given module.boolean
Module. isOpen(String pn,Module other)
Returnstrue
if this module hasopened a package to at least the given module.Uses ofModule injava.lang.instrument
Methods injava.lang.instrument with parameters of typeModule Modifier and Type Method Description boolean
Instrumentation. isModifiableModule(Module module)
Tests whether a module can be modified withredefineModule
.void
Instrumentation. redefineModule(Module module,Set<Module> extraReads,Map<String,Set<Module>> extraExports,Map<String,Set<Module>> extraOpens,Set<Class<?>> extraUses,Map<Class<?>,List<Class<?>>> extraProvides)
Redefine a module to expand the set of modules that it reads, the set of packages that it exports or opens, or the services that it uses or provides.default byte[]
ClassFileTransformer. transform(Module module,ClassLoader loader,String className,Class<?> classBeingRedefined,ProtectionDomain protectionDomain, byte[] classfileBuffer)
Transforms the given class file and returns a new replacement class file.Method parameters injava.lang.instrument with type arguments of typeModule Modifier and Type Method Description void
Instrumentation. redefineModule(Module module,Set<Module> extraReads,Map<String,Set<Module>> extraExports,Map<String,Set<Module>> extraOpens,Set<Class<?>> extraUses,Map<Class<?>,List<Class<?>>> extraProvides)
Redefine a module to expand the set of modules that it reads, the set of packages that it exports or opens, or the services that it uses or provides.void
Instrumentation. redefineModule(Module module,Set<Module> extraReads,Map<String,Set<Module>> extraExports,Map<String,Set<Module>> extraOpens,Set<Class<?>> extraUses,Map<Class<?>,List<Class<?>>> extraProvides)
Redefine a module to expand the set of modules that it reads, the set of packages that it exports or opens, or the services that it uses or provides.Uses ofModule injava.util
Methods injava.util with parameters of typeModule Modifier and Type Method Description staticResourceBundle
ResourceBundle. getBundle(String baseName,Module module)
Gets a resource bundle using the specified base name and the default locale on behalf of the specified module.staticResourceBundle
ResourceBundle. getBundle(String baseName,Locale targetLocale,Module module)
Gets a resource bundle using the specified base name and locale on behalf of the specified module.