Class ModuleInfoReader

java.lang.Object
io.avaje.spi.internal.ModuleInfoReader

@Generated("avaje-prism-generator") public class ModuleInfoReader extends Object
Helper Class to work with an application's root module-info.

Calling ModuleElement.getDirectives() on the application module can break compilation in some situations, so this class helps parse the module source file and get the relevant information without breaking anything.

  • Constructor Details

    • ModuleInfoReader

      public ModuleInfoReader() throws IOException
      Parse the module-info.java using the ModuleElement from the APContext and create a new instance
      Throws:
      IOException
    • ModuleInfoReader

      public ModuleInfoReader(ModuleElement moduleElement, BufferedReader reader) throws IOException
      Parse a module-info and create a new instance
      Parameters:
      moduleElement - the element representing the root module
      reader - a reader for the contents of the module-info.java
      Throws:
      IOException
    • ModuleInfoReader

      public ModuleInfoReader(ModuleElement moduleElement, CharSequence moduleString)
      Parse a module-info and create a new instance
      Parameters:
      moduleElement - the element representing the root module
      moduleString - a string containing the contents of the module-info.java
  • Method Details

    • containsOnModulePath

      public boolean containsOnModulePath(String moduleName)
      Check to see whether the given module is on the module path as a non-static dependency
      Parameters:
      moduleName -
      Returns:
      whether the given module is on the path
    • validateServices

      public void validateServices(String providesType, Collection<String> implementations)
      Checks whether the module-info has the defined provides directive and all their implementations Will register an error message compilation
      Parameters:
      providesType - the provides directive to check
      implementations - the implementations to verify the presence of
    • requires

      public List<ModuleInfoReader.Requires> requires()
      The requires directives associated with this module
    • uses

      public List<ModuleInfoReader.Uses> uses()
      The uses directives associated with this module
    • exports

      public List<ModuleInfoReader.Exports> exports()
      The exports directives associated with this module
    • opens

      public List<ModuleInfoReader.Opens> opens()
      The opens directives associated with this module
    • provides

      public List<ModuleInfoReader.Provides> provides()
      The provides directives associated with this module