Package: org.codehaus.groovy.runtime.m12n

## [Java] Class StandardPropertiesModuleFactory

- org.codehaus.groovy.runtime.m12n.StandardPropertiesModuleFactory

-     public class StandardPropertiesModuleFactory
      extends PropertiesModuleFactory

  This is the standard Groovy module factory. This factory will build a module using the MetaInfExtensionModule by default, unless a key named "moduleFactory" is found in the properties file. If this is the case, then a new factory is instantiated and used instead of this factory.

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static String` | `MODULE_FACTORY_KEY` | Property key in META-INF configuration file for specifying a custom module factory class.

  - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class PropertiesModuleFactory` | `MODULE_NAME_KEY, MODULE_VERSION_KEY`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public ExtensionModule` | `newModule(Properties properties, ClassLoader classLoader)` Creates a new extension module from the given properties.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class PropertiesModuleFactory` | `newModule`

- - ### Field Detail

    - #### public static final String MODULE_FACTORY_KEY

      Property key in META-INF configuration file for specifying a custom module factory class. If specified, the factory class must extend PropertiesModuleFactory and have a no-arg constructor.

  - ### Method Detail

    - #### public ExtensionModule newModule(Properties properties, ClassLoader classLoader)

      Creates a new extension module from the given properties. If the properties contain a custom factory class name under the key MODULE_FACTORY_KEY, that factory is instantiated and used. Otherwise, a MetaInfExtensionModule is created.

      throws:
        GroovyRuntimeException if the custom factory cannot be loaded or instantiated
      Parameters:
        `properties` - the module metadata properties
        `classLoader` - the class loader to use for loading extension classes and custom factory classes
      Returns:
        a new extension module