org.springframework.core.io.support

## 类 SpringFactoriesLoader

- java.lang.Object
- - org.springframework.core.io.support.SpringFactoriesLoader

-     public abstract class SpringFactoriesLoader
      extends Object

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

  `SpringFactoriesLoader` loads and instantiates factories of a given type from "META-INF/spring.factories" files which may be present in multiple JAR files in the classpath. The `spring.factories` file must be in `Properties` format, where the key is the fully qualified name of the interface or abstract class, and the value is a comma-separated list of implementation class names. For example:

      example.MyService=example.MyServiceImpl1,example.MyServiceImpl2

  where `example.MyService` is the name of the interface, and `MyServiceImpl1` and `MyServiceImpl2` are two implementations.
  从以下版本开始:
    3.2
  作者:
    Arjen Poutsma, Juergen Hoeller, Sam Brannen

- - ### 字段概要

    字段
    限定符和类型 | 字段和说明
    --- | ---
    `static String` | `FACTORIES_RESOURCE_LOCATION` The location to look for factories.

  - ### 构造器概要

    构造器
    构造器和说明
    `SpringFactoriesLoader()`

  - ### 方法概要

    所有方法 静态方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `static <T> List<T>` | `loadFactories(Class<T> factoryClass, ClassLoader classLoader)` Load and instantiate the factory implementations of the given type from "META-INF/spring.factories", using the given class loader.
    `static List<String>` | `loadFactoryNames(Class<?> factoryClass, ClassLoader classLoader)` Load the fully qualified class names of factory implementations of the given type from "META-INF/spring.factories", using the given class loader.

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 字段详细资料

    - #### FACTORIES_RESOURCE_LOCATION

          public static final String FACTORIES_RESOURCE_LOCATION

      The location to look for factories.

      Can be present in multiple JAR files.

      另请参阅:
        常量字段值

  - ### 构造器详细资料

    - #### SpringFactoriesLoader

          public SpringFactoriesLoader()

  - ### 方法详细资料

    - #### loadFactories

          public static <T> List<T> loadFactories(Class<T> factoryClass,
                                                  @Nullable
                                                  ClassLoader classLoader)

      Load and instantiate the factory implementations of the given type from "META-INF/spring.factories", using the given class loader.

      The returned factories are sorted through `AnnotationAwareOrderComparator`.

      If a custom instantiation strategy is required, use `loadFactoryNames(java.lang.Class<?>, java.lang.ClassLoader)` to obtain all registered factory names.

      参数:
        `factoryClass` - the interface or abstract class representing the factory
        `classLoader` - the ClassLoader to use for loading (can be `null` to use the default)
      抛出:
        `IllegalArgumentException` - if any factory implementation class cannot be loaded or if an error occurs while instantiating any factory
      另请参阅:
        `loadFactoryNames(java.lang.Class<?>, java.lang.ClassLoader)`

    - #### loadFactoryNames

          public static List<String> loadFactoryNames(Class<?> factoryClass,
                                                      @Nullable
                                                      ClassLoader classLoader)

      Load the fully qualified class names of factory implementations of the given type from "META-INF/spring.factories", using the given class loader.
      参数:
        `factoryClass` - the interface or abstract class representing the factory
        `classLoader` - the ClassLoader to use for loading resources; can be `null` to use the default
      抛出:
        `IllegalArgumentException` - if an error occurs while loading factory names
      另请参阅:
        `loadFactories(java.lang.Class<T>, java.lang.ClassLoader)`