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 booleancanRead(java.lang.Object value, java.lang.Object target)Checks if the source module can read the target module.java.lang.ClassLoadergetClassLoader(java.lang.Object value)Returns the class loader of a module.java.lang.StringgetName(java.lang.Object value)Returns the module's name.java.util.Set<java.lang.String>getPackages(java.lang.Object value)Returns the module's exported packages.java.io.InputStreamgetResourceAsStream(java.lang.Object value, java.lang.String name)Returns a resource stream for this module for a resource of the given name ornullif such a resource does not exist.booleanisExported(java.lang.Object value, java.lang.String aPackage, java.lang.Object target)Returnstrueif the source module exports the supplied package to the target module.booleanisInstance(java.lang.Object value)Returnstrueif the supplied instance is of typejava.lang.Module.booleanisNamed(java.lang.Object value)Returnstrueif the supplied module is named.booleanisOpen(java.lang.Object value, java.lang.String aPackage, java.lang.Object target)Returnstrueif the source module opens the supplied package to the target module.
-
-
-
Method Detail
-
isInstance
@Instance boolean isInstance(java.lang.Object value)
Returnstrueif the supplied instance is of typejava.lang.Module.- Parameters:
value- The instance to investigate.- Returns:
trueif the supplied value is ajava.lang.Module.
-
isNamed
boolean isNamed(java.lang.Object value)
Returnstrueif the supplied module is named.- Parameters:
value- Thejava.lang.Moduleto check for the existence of a name.- Returns:
trueif the supplied module is named.
-
getName
java.lang.String getName(java.lang.Object value)
Returns the module's name.- Parameters:
value- Thejava.lang.Moduleto check for its name.- Returns:
- The module's (implicit or explicit) name.
-
getPackages
java.util.Set<java.lang.String> getPackages(java.lang.Object value)
Returns the module's exported packages.- Parameters:
value- Thejava.lang.Moduleto check for its packages.- Returns:
- The module's packages.
-
getClassLoader
@MaybeNull java.lang.ClassLoader getClassLoader(java.lang.Object value)
Returns the class loader of a module.- Parameters:
value- Thejava.lang.Modulefor 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 ornullif such a resource does not exist.- Parameters:
value- Thejava.lang.Moduleinstance to apply this method upon.name- The name of the resource.- Returns:
- An input stream for the resource or
nullif 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)Returnstrueif 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:
trueif 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)Returnstrueif 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:
trueif 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:
trueif the source module can read the target module.
-
-