GrailsFactoriesLoader (Grails 4.0.11)
Date: 2021-06-24

Package: org.grails.core.io.support

## [Groovy] Class GrailsFactoriesLoader

- org.grails.core.io.support.GrailsFactoriesLoader

- General purpose factory loading mechanism for internal use within the framework.

  Based on org.springframework.core.io.support.SpringFactoriesLoader, but applies caching and uses a different file name

  Since:
    2.4
  Authors:
    Graeme Rocher

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `<T>` | `static java.util.List<T>` | `loadFactories(java.lang.Class<T> factoryClass)` Load the factory implementations of the given type from the default location, using the given class loader.
    `<T>` | `static java.util.List<T>` | `loadFactories(java.lang.Class<T> factoryClass, java.lang.ClassLoader classLoader)` Load the factory implementations of the given type from the default location, using the given class loader.
    `<T>` | `static java.util.List<T>` | `loadFactoriesWithArguments(java.lang.Class<T> factoryClass, java.lang.ClassLoader classLoader, java.lang.Object[] arguments)`
    `<T>` | `static T` | `loadFactory(java.lang.Class<T> factoryClass, java.lang.ClassLoader classLoader = GrailsFactoriesLoader.class.classLoader)`
    `<T>` | `static T` | `loadFactory(java.lang.Class<T> factoryClass, java.lang.Object... arguments)`
    `<T>` | `static T` | `loadFactory(java.lang.Class<T> factoryClass, java.lang.ClassLoader classLoader, java.lang.Object... arguments)`
    `<T>` | `static java.util.List<java.lang.Class<T>>` | `loadFactoryClasses(java.lang.Class<T> factoryClass, java.lang.ClassLoader classLoader = GrailsFactoriesLoader.class.classLoader)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class FactoriesLoaderSupport` | `loadFactoryNames, loadFactoryNames`

- - ### Method Detail

    - #### <T> static java.util.List<T> loadFactories(java.lang.Class<T> factoryClass)

      Load the factory implementations of the given type from the default location, using the given class loader.

      The returned factories are ordered in accordance with the org.springframework.core.OrderComparator.

      Parameters:
        `factoryClass` - the interface or abstract class representing the factory

    - #### <T> static java.util.List<T> loadFactories(java.lang.Class<T> factoryClass, java.lang.ClassLoader classLoader)

      Load the factory implementations of the given type from the default location, using the given class loader.

      The returned factories are ordered in accordance with the org.springframework.core.OrderComparator.

      Parameters:
        `factoryClass` - the interface or abstract class representing the factory
        `classLoader` - the ClassLoader to use for loading (can be `null` to use the default)

    - #### <T> static java.util.List<T> loadFactoriesWithArguments(java.lang.Class<T> factoryClass, java.lang.ClassLoader classLoader, java.lang.Object[] arguments)

    - #### <T> static T loadFactory(java.lang.Class<T> factoryClass, java.lang.ClassLoader classLoader = GrailsFactoriesLoader.class.classLoader)

    - #### <T> static T loadFactory(java.lang.Class<T> factoryClass, java.lang.Object... arguments)

    - #### <T> static T loadFactory(java.lang.Class<T> factoryClass, java.lang.ClassLoader classLoader, java.lang.Object... arguments)

    - #### <T> static java.util.List<java.lang.Class<T>> loadFactoryClasses(java.lang.Class<T> factoryClass, java.lang.ClassLoader classLoader = GrailsFactoriesLoader.class.classLoader)