Interface JavaModule.Module

Enclosing class:
JavaModule

@Proxied("java.lang.Module") protected static interface JavaModule.Module
A proxy for interacting with java.lang.Module.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canRead(Object value, Object target)
    Checks if the source module can read the target module.
    Returns the class loader of a module.
    getName(Object value)
    Returns the module's name.
    Returns a resource stream for this module for a resource of the given name or null if such a resource does not exist.
    boolean
    isExported(Object value, String aPackage, Object target)
    Returns true if the source module exports the supplied package to the target module.
    boolean
    Returns true if the supplied instance is of type java.lang.Module.
    boolean
    isNamed(Object value)
    Returns true if the supplied module is named.
    boolean
    isOpen(Object value, String aPackage, Object target)
    Returns true if the source module opens the supplied package to the target module.
  • Method Details

    • isInstance

      @Instance boolean isInstance(Object value)
      Returns true if the supplied instance is of type java.lang.Module.
      Parameters:
      value - The instance to investigate.
      Returns:
      true if the supplied value is a java.lang.Module.
    • isNamed

      boolean isNamed(Object value)
      Returns true if the supplied module is named.
      Parameters:
      value - The java.lang.Module to check for the existence of a name.
      Returns:
      true if the supplied module is named.
    • getName

      String getName(Object value)
      Returns the module's name.
      Parameters:
      value - The java.lang.Module to check for its name.
      Returns:
      The module's (implicit or explicit) name.
    • getClassLoader

      @MaybeNull ClassLoader getClassLoader(Object value)
      Returns the class loader of a module.
      Parameters:
      value - The java.lang.Module for which to return a class loader.
      Returns:
      The module's class loader.
    • getResourceAsStream

      @MaybeNull InputStream getResourceAsStream(Object value, String name) throws IOException
      Returns a resource stream for this module for a resource of the given name or null if such a resource does not exist.
      Parameters:
      value - The java.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

      boolean isExported(Object value, String aPackage, @Proxied("java.lang.Module") Object target)
      Returns true 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(Object value, String aPackage, @Proxied("java.lang.Module") Object target)
      Returns true 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(Object value, @Proxied("java.lang.Module") 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.