Package: org.codehaus.groovy.runtime.m12n

## [Java] Class ExtensionModuleScanner

- org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner

-     public class ExtensionModuleScanner
      extends Object

  A module extension scanner is responsible for searching classpath modules, loading metadata from module descriptors, then perform custom tasks for each module. This class was introduced as a fix for GROOVY-6008

  Since:
    2.1.2

- - ### Nested Class Summary

    Nested classes
    Modifiers | Name | Description
    --- | --- | ---
    `interface` | `ExtensionModuleScanner.ExtensionModuleListener` | Listener interface for extension module discovery events.

  - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static String` | `LEGACY_MODULE_META_INF_FILE` | Legacy location for META-INF module metadata files (Java services format).
    `static String` | `MODULE_META_INF_FILE` | Current location for META-INF module metadata files (Java properties format).

  - ### Constructor Summary

    Constructors
    Constructor and description
    `ExtensionModuleScanner(ExtensionModuleScanner.ExtensionModuleListener listener, ClassLoader loader)` Constructs a new ExtensionModuleScanner.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `scanClasspathModules()` Scans the classpath for extension module metadata files.
    `` | `public void` | `scanExtensionModuleFromProperties(Properties properties)` Scans and creates an extension module from the given properties.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### public static final String LEGACY_MODULE_META_INF_FILE

      Legacy location for META-INF module metadata files (Java services format).

    - #### public static final String MODULE_META_INF_FILE

      Current location for META-INF module metadata files (Java properties format).

  - ### Constructor Detail

    - #### public ExtensionModuleScanner(ExtensionModuleScanner.ExtensionModuleListener listener, ClassLoader loader)

      Constructs a new ExtensionModuleScanner.

      Parameters:
        `listener` - the listener to be notified when modules are discovered
        `loader` - the class loader to use for scanning and loading modules

  - ### Method Detail

    - #### public void scanClasspathModules()

      Scans the classpath for extension module metadata files. This method scans for both the current and legacy module metadata file locations.

    - #### public void scanExtensionModuleFromProperties(Properties properties)

      Scans and creates an extension module from the given properties. Properties are typically loaded from a module metadata file (properties format).

      Parameters:
        `properties` - the module metadata properties