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

  Authors:
    Graeme Rocher
  Since:
    2.4

- - ### 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`
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### 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)