Package: org.codehaus.groovy.runtime.m12n

## [Java] Class ExtensionModuleRegistry

- org.codehaus.groovy.runtime.m12n.ExtensionModuleRegistry

-     public class ExtensionModuleRegistry
      extends Object

  The extension method registry is responsible for collecting methods (or static methods) which are added to existing classes and may be called like regular methods.

  In previous Groovy versions, such methods could only be defined in a single class called DefaultGroovyMethods for instance methods, and DefaultGroovyStaticMethods for static methods.

  Since:
    2.0.0

- - ### Constructor Summary

    Constructors
    Constructor and description
    `ExtensionModuleRegistry()` Constructs a new ExtensionModuleRegistry with an empty module list.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `addModule(ExtensionModule module)` Adds an extension module to this registry.
    `` | `public ExtensionModule` | `getModule(String moduleName)` Retrieves a registered extension module by its name.
    `` | `public List<ExtensionModule>` | `getModules()` Returns a copy of the list of all registered extension modules.
    `` | `public boolean` | `hasModule(String moduleName)` Checks if an extension module with the given name is registered.
    `` | `public void` | `removeModule(ExtensionModule module)` Removes an extension module from this registry.

  - ### Inherited Methods Summary

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

- - ### Constructor Detail

    - #### public ExtensionModuleRegistry()

      Constructs a new ExtensionModuleRegistry with an empty module list.

  - ### Method Detail

    - #### public void addModule(ExtensionModule module)

      Adds an extension module to this registry.

      Parameters:
        `module` - the extension module to add

    - #### public ExtensionModule getModule(String moduleName)

      Retrieves a registered extension module by its name.

      Parameters:
        `moduleName` - the name of the module to retrieve
      Returns:
        the extension module with the given name, or null if not found

    - #### public List<ExtensionModule> getModules()

      Returns a copy of the list of all registered extension modules.

      Returns:
        a list containing all registered extension modules

    - #### public boolean hasModule(String moduleName)

      Checks if an extension module with the given name is registered.

      Parameters:
        `moduleName` - the name of the module to check
      Returns:
        true if a module with the given name is registered, false otherwise

    - #### public void removeModule(ExtensionModule module)

      Removes an extension module from this registry.

      Parameters:
        `module` - the extension module to remove