Class ModulePathInfo

java.lang.Object
io.github.classgraph.ModulePathInfo

public class ModulePathInfo extends 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
    final Set<String>
    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.
    final Set<String>
    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.
    final Set<String>
    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.
    final Set<String>
    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 final List<Character>
    The module path commandline switch value delimiters.
    private static final List<String>
    The module path commandline switches.
    private final List<Set<String>>
    The fields.
    private final AtomicBoolean
    Set to true once
    invalid reference
    #getRuntimeInfo()
    is called.
    final Set<String>
    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.
    final Set<String>
    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
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    Fill in module info from VM commandline parameters.
    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 Details

    • modulePath

      public final Set<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 Set<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 Set<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 Set<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 Set<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 Set<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 List<Set<String>> fields
      The fields.
    • argSwitches

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

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

      private final AtomicBoolean gotRuntimeInfo
      Set to true once
      invalid reference
      #getRuntimeInfo()
      is called.
  • Constructor Details

    • ModulePathInfo

      public ModulePathInfo()
  • Method Details

    • getRuntimeInfo

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

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