Class ModulePathInfo


  • public class ModulePathInfo
    extends java.lang.Object
    Information on the module path. Note that this will only include module system parameters actually listed in commandline arguments -- in particular this does not include classpath elements from the traditional classpath, or system modules.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.util.Set<java.lang.String> addExports
      The module exports directives added on the commandline using the --add-exports switch, as an ordered set of strings in the format <source-module>/<package>=<target-module>(,<target-module>)*, in the order they were listed on the commandline.
      java.util.Set<java.lang.String> addModules
      The modules added to the module path on the commandline using the --add-modules switch, as an ordered set of module names, in the order they were listed on the commandline.
      java.util.Set<java.lang.String> addOpens
      The module opens directives added on the commandline using the --add-opens switch, as an ordered set of strings in the format <source-module>/<package>=<target-module>(,<target-module>)*, in the order they were listed on the commandline.
      java.util.Set<java.lang.String> addReads
      The module reads directives added on the commandline using the --add-reads switch, as an ordered set of strings in the format <source-module>=<target-module>, in the order they were listed on the commandline.
      private static java.util.List<java.lang.Character> argPartSeparatorChars
      The module path commandline switch value delimiters.
      private static java.util.List<java.lang.String> argSwitches
      The module path commandline switches.
      private java.util.List<java.util.Set<java.lang.String>> fields
      The fields.
      private java.util.concurrent.atomic.AtomicBoolean gotRuntimeInfo
      Set to true once #getRuntimeInfo() is called.
      java.util.Set<java.lang.String> modulePath
      The module path provided on the commandline by the --module-path or -p switch, as an ordered set of module names, in the order they were listed on the commandline.
      java.util.Set<java.lang.String> patchModules
      The module patch directives listed on the commandline using the --patch-module switch, as an ordered set of strings in the format <module>=<file>, in the order they were listed on the commandline.
    • Constructor Summary

      Constructors 
      Constructor Description
      ModulePathInfo()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void getRuntimeInfo​(ReflectionUtils reflectionUtils)
      Fill in module info from VM commandline parameters.
      java.lang.String toString()
      Return the module path info in commandline format.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • modulePath

        public final java.util.Set<java.lang.String> modulePath
        The module path provided on the commandline by the --module-path or -p switch, as an ordered set of module names, in the order they were listed on the commandline.

        Note that some modules (such as system modules) will not be in this set, as they are added to the module system automatically by the runtime. Call ClassGraph.getModules() or ScanResult.getModules() to get all modules visible at runtime.

      • addModules

        public final java.util.Set<java.lang.String> addModules
        The modules added to the module path on the commandline using the --add-modules switch, as an ordered set of module names, in the order they were listed on the commandline. Note that valid module names include ALL-DEFAULT, ALL-SYSTEM, and ALL-MODULE-PATH (see JEP 261 for info).
      • patchModules

        public final java.util.Set<java.lang.String> patchModules
        The module patch directives listed on the commandline using the --patch-module switch, as an ordered set of strings in the format <module>=<file>, in the order they were listed on the commandline.
      • addExports

        public final java.util.Set<java.lang.String> addExports
        The module exports directives added on the commandline using the --add-exports switch, as an ordered set of strings in the format <source-module>/<package>=<target-module>(,<target-module>)*, in the order they were listed on the commandline. Additionally, if this ModulePathInfo object was obtained from ScanResult.getModulePathInfo() rather than ClassGraph.getModulePathInfo(), any additional Add-Exports entries found in manifest files during classpath scanning will be appended to this list, in the format <source-module>/<package>=ALL-UNNAMED.
      • addOpens

        public final java.util.Set<java.lang.String> addOpens
        The module opens directives added on the commandline using the --add-opens switch, as an ordered set of strings in the format <source-module>/<package>=<target-module>(,<target-module>)*, in the order they were listed on the commandline. Additionally, if this ModulePathInfo object was obtained from ScanResult.getModulePathInfo() rather than ClassGraph.getModulePathInfo(), any additional Add-Opens entries found in manifest files during classpath scanning will be appended to this list, in the format <source-module>/<package>=ALL-UNNAMED.
      • addReads

        public final java.util.Set<java.lang.String> addReads
        The module reads directives added on the commandline using the --add-reads switch, as an ordered set of strings in the format <source-module>=<target-module>, in the order they were listed on the commandline.
      • fields

        private final java.util.List<java.util.Set<java.lang.String>> fields
        The fields.
      • argSwitches

        private static final java.util.List<java.lang.String> argSwitches
        The module path commandline switches.
      • argPartSeparatorChars

        private static final java.util.List<java.lang.Character> argPartSeparatorChars
        The module path commandline switch value delimiters.
      • gotRuntimeInfo

        private final java.util.concurrent.atomic.AtomicBoolean gotRuntimeInfo
        Set to true once #getRuntimeInfo() is called.
    • Constructor Detail

      • ModulePathInfo

        public ModulePathInfo()
    • Method Detail

      • getRuntimeInfo

        void getRuntimeInfo​(ReflectionUtils reflectionUtils)
        Fill in module info from VM commandline parameters.
      • toString

        public java.lang.String toString()
        Return the module path info in commandline format.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the module path commandline string.