Class ModuleDescription.ForLoadedModule

    • Constructor Detail

      • ForLoadedModule

        protected ForLoadedModule​(java.lang.reflect.AnnotatedElement module)
        Creates a new module description for the supplied module.
        Parameters:
        module - The module to represent.
    • Method Detail

      • of

        public static ModuleDescription of​(java.lang.Object module)
        Creates a module description for the supplied module.
        Parameters:
        module - The module to represent.
        Returns:
        A module description for the supplied module.
        Throws:
        java.lang.IllegalArgumentException - If the supplied instance is not a module or if the module is unnamed.
      • doPrivileged

        @Enhance
        private static <T> T doPrivileged​(java.security.PrivilegedAction<T> action)
        A proxy for java.security.AccessController#doPrivileged that is activated if available.
        Type Parameters:
        T - The type of the action's resolved value.
        Parameters:
        action - The action to execute from a privileged context.
        Returns:
        The action's resolved value.
      • getVersion

        @MaybeNull
        public java.lang.String getVersion()
        Returns the version of this module.
        Returns:
        The module's version or null if no version is specified.
      • getMainClass

        @MaybeNull
        public java.lang.String getMainClass()
        Returns the main class of this module.
        Returns:
        The module's main class or null if no main class is specified.
      • getPackages

        public java.util.Set<java.lang.String> getPackages()
        Returns all packages contained in this module.
        Returns:
        A set of all package names within this module.
      • getUses

        public java.util.Set<java.lang.String> getUses()
        Returns all service types that this module uses.
        Returns:
        A set of service class names that this module uses.
      • getExports

        public java.util.Map<java.lang.String,​ModuleDescription.Exports> getExports()
        Returns all package exports of this module.
        Returns:
        A mapping of package names to their export declarations.
      • getOpens

        public java.util.Map<java.lang.String,​ModuleDescription.Opens> getOpens()
        Returns all package opens of this module.
        Returns:
        A mapping of package names to their opens declarations.
      • getRequires

        public java.util.Map<java.lang.String,​ModuleDescription.Requires> getRequires()
        Returns all module dependencies of this module.
        Returns:
        A mapping of module names to their require declarations.
      • getProvides

        public java.util.Map<java.lang.String,​ModuleDescription.Provides> getProvides()
        Returns all service implementations provided by this module.
        Returns:
        A mapping of service names to their provider declarations.
      • getModifiers

        public int getModifiers()
        Returns the modifier that is described by this object.
        Returns:
        The modifier that is described by this object.
      • getActualName

        public java.lang.String getActualName()
        Returns the display name of this element as it is found in the source code. If no such name exists, an empty string is returned.
        Returns:
        The name of this element as given in a Java program's source code.
      • getDeclaredAnnotations

        public AnnotationList getDeclaredAnnotations()
        Returns a list of annotations that are declared by this instance.
        Returns:
        A list of declared annotations.