Package net.bytebuddy.utility
Interface JavaModule.Module
-
- Enclosing class:
- JavaModule
@Proxied("java.lang.Module") protected static interface JavaModule.Module
A proxy for interacting withjava.lang.Module
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canRead(java.lang.Object value, java.lang.Object target)
Checks if the source module can read the target module.java.lang.ClassLoader
getClassLoader(java.lang.Object value)
Returns the class loader of a module.java.lang.String
getName(java.lang.Object value)
Returns the module's name.java.io.InputStream
getResourceAsStream(java.lang.Object value, java.lang.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(java.lang.Object value, java.lang.String aPackage, java.lang.Object target)
Returnstrue
if the source module exports the supplied package to the target module.boolean
isInstance(java.lang.Object value)
Returnstrue
if the supplied instance is of typejava.lang.Module
.boolean
isNamed(java.lang.Object value)
Returnstrue
if the supplied module is named.boolean
isOpen(java.lang.Object value, java.lang.String aPackage, java.lang.Object target)
Returnstrue
if the source module opens the supplied package to the target module.
-
-
-
Method Detail
-
isInstance
@Instance boolean isInstance(java.lang.Object value)
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
boolean isNamed(java.lang.Object value)
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
java.lang.String getName(java.lang.Object value)
Returns the module's name.- Parameters:
value
- Thejava.lang.Module
to check for its name.- Returns:
- The module's (implicit or explicit) name.
-
getClassLoader
@MaybeNull java.lang.ClassLoader getClassLoader(java.lang.Object value)
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
@MaybeNull java.io.InputStream getResourceAsStream(java.lang.Object value, java.lang.String name) throws java.io.IOException
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:
java.io.IOException
- If an I/O exception occurs.
-
isExported
boolean isExported(java.lang.Object value, java.lang.String aPackage, @Proxied("java.lang.Module") java.lang.Object target)
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
boolean isOpen(java.lang.Object value, java.lang.String aPackage, @Proxied("java.lang.Module") java.lang.Object target)
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
boolean canRead(java.lang.Object value, @Proxied("java.lang.Module") java.lang.Object target)
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.
-
-