Package net.bytebuddy.utility
Interface JavaModule.Module
- Enclosing class:
JavaModule
A proxy for interacting with
java.lang.Module
.-
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if the source module can read the target module.getClassLoader
(Object value) Returns the class loader of a module.Returns the module's name.getPackages
(Object value) Returns the module's exported packages.getResourceAsStream
(Object value, String name) Returns a resource stream for this module for a resource of the given name ornull
if such a resource does not exist.boolean
isExported
(Object value, String aPackage, Object target) Returnstrue
if the source module exports the supplied package to the target module.boolean
isInstance
(Object value) Returnstrue
if the supplied instance is of typejava.lang.Module
.boolean
Returnstrue
if the supplied module is named.boolean
Returnstrue
if the source module opens the supplied package to the target module.
-
Method Details
-
isInstance
Returnstrue
if the supplied instance is of typejava.lang.Module
.- Parameters:
value
- The instance to investigate.- Returns:
true
if the supplied value is ajava.lang.Module
.
-
isNamed
Returnstrue
if the supplied module is named.- Parameters:
value
- Thejava.lang.Module
to check for the existence of a name.- Returns:
true
if the supplied module is named.
-
getName
Returns the module's name.- Parameters:
value
- Thejava.lang.Module
to check for its name.- Returns:
- The module's (implicit or explicit) name.
-
getPackages
Returns the module's exported packages.- Parameters:
value
- Thejava.lang.Module
to check for its packages.- Returns:
- The module's packages.
-
getClassLoader
Returns the class loader of a module.- Parameters:
value
- Thejava.lang.Module
for which to return a class loader.- Returns:
- The module's class loader.
-
getResourceAsStream
Returns a resource stream for this module for a resource of the given name ornull
if such a resource does not exist.- Parameters:
value
- Thejava.lang.Module
instance to apply this method upon.name
- The name of the resource.- Returns:
- An input stream for the resource or
null
if it does not exist. - Throws:
IOException
- If an I/O exception occurs.
-
isExported
Returnstrue
if the source module exports the supplied package to the target module.- Parameters:
value
- The source module.aPackage
- The name of the package to check.target
- The target module.- Returns:
true
if the source module exports the supplied package to the target module.
-
isOpen
Returnstrue
if the source module opens the supplied package to the target module.- Parameters:
value
- The source module.aPackage
- The name of the package to check.target
- The target module.- Returns:
true
if the source module opens the supplied package to the target module.
-
canRead
Checks if the source module can read the target module.- Parameters:
value
- The source module.target
- The target module.- Returns:
true
if the source module can read the target module.
-