Class SpringFactoriesLoader

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

public final 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.
Since:
3.2
Author:
Arjen Poutsma, Juergen Hoeller, Sam Brannen
  • Field Details

    • FACTORIES_RESOURCE_LOCATION

      public static final String FACTORIES_RESOURCE_LOCATION
      The location to look for factories.

      Can be present in multiple JAR files.

      See Also:
  • Method Details