Enum JavaModule.Dispatcher.Disabled

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      INSTANCE
      The singleton instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addReads​(java.lang.instrument.Instrumentation instrumentation, java.lang.Object source, java.lang.Object target)
      Adds a read-edge from the source to the target module.
      boolean canRead​(java.lang.Object source, java.lang.Object target)
      Checks if the source module can read the target module.
      java.lang.ClassLoader getClassLoader​(java.lang.Object module)
      Returns the module's class loader.
      java.lang.String getName​(java.lang.Object module)
      Returns the module's name.
      java.io.InputStream getResourceAsStream​(java.lang.Object module, java.lang.String 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 isAlive()
      Checks if this dispatcher is alive, i.e.
      boolean isNamed​(java.lang.Object module)
      Returns true if the supplied module is named.
      JavaModule moduleOf​(java.lang.Class<?> type)
      Extracts the Java Module for the provided class or returns null if the current VM does not support modules.
      static JavaModule.Dispatcher.Disabled valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static JavaModule.Dispatcher.Disabled[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • values

        public static JavaModule.Dispatcher.Disabled[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (JavaModule.Dispatcher.Disabled c : JavaModule.Dispatcher.Disabled.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static JavaModule.Dispatcher.Disabled valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • isAlive

        public boolean isAlive()
        Description copied from interface: JavaModule.Dispatcher
        Checks if this dispatcher is alive, i.e. supports modules.
        Specified by:
        isAlive in interface JavaModule.Dispatcher
        Returns:
        true if modules are supported on the current VM.
      • moduleOf

        public JavaModule moduleOf​(java.lang.Class<?> type)
        Description copied from interface: JavaModule.Dispatcher
        Extracts the Java Module for the provided class or returns null if the current VM does not support modules.
        Specified by:
        moduleOf in interface JavaModule.Dispatcher
        Parameters:
        type - The type for which to extract the module.
        Returns:
        The class's Module or null if the current VM does not support modules.
      • getClassLoader

        public java.lang.ClassLoader getClassLoader​(java.lang.Object module)
        Description copied from interface: JavaModule.Dispatcher
        Returns the module's class loader.
        Specified by:
        getClassLoader in interface JavaModule.Dispatcher
        Parameters:
        module - The java.lang.Module
        Returns:
        The module's class loader.
      • isNamed

        public boolean isNamed​(java.lang.Object module)
        Description copied from interface: JavaModule.Dispatcher
        Returns true if the supplied module is named.
        Specified by:
        isNamed in interface JavaModule.Dispatcher
        Parameters:
        module - The java.lang.Module to check for the existence of a name.
        Returns:
        true if the supplied module is named.
      • getName

        public java.lang.String getName​(java.lang.Object module)
        Description copied from interface: JavaModule.Dispatcher
        Returns the module's name.
        Specified by:
        getName in interface JavaModule.Dispatcher
        Parameters:
        module - The java.lang.Module to check for its name.
        Returns:
        The module's (implicit or explicit) name.
      • getResourceAsStream

        public java.io.InputStream getResourceAsStream​(java.lang.Object module,
                                                       java.lang.String name)
        Description copied from interface: JavaModule.Dispatcher
        Returns a resource stream for this module for a resource of the given name or null if such a resource does not exist.
        Specified by:
        getResourceAsStream in interface JavaModule.Dispatcher
        Parameters:
        module - 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.
      • canRead

        public boolean canRead​(java.lang.Object source,
                               java.lang.Object target)
        Description copied from interface: JavaModule.Dispatcher
        Checks if the source module can read the target module.
        Specified by:
        canRead in interface JavaModule.Dispatcher
        Parameters:
        source - The source module.
        target - The target module.
        Returns:
        true if the source module can read the target module.
      • addReads

        public void addReads​(java.lang.instrument.Instrumentation instrumentation,
                             java.lang.Object source,
                             java.lang.Object target)
        Description copied from interface: JavaModule.Dispatcher
        Adds a read-edge from the source to the target module.
        Specified by:
        addReads in interface JavaModule.Dispatcher
        Parameters:
        instrumentation - The instrumentation instance to use for adding the edge.
        source - The source module.
        target - The target module.