SpringFactories class final
What the starters of an application add to it before its beans exist:
the constants of every AutoConfigurationModule.factories, found by
their type.
Some things must work while the environment is prepared or a splash
shows, when no bean exists yet (the design a Flutter theme is read
with). A starter lists them on its module, and the code that needs them
asks for a type. The application has it as
SpringApplication.factories, and the context as the
springFactories bean.
// In a listener of ApplicationEnvironmentPreparedEvent.
final designs = event.springApplication.factories.load<ThemeDesign>();
Spring (Java):
List<ThemeDesign> designs =
SpringFactoriesLoader.loadFactories(ThemeDesign.class, classLoader);
Spring finds them in META-INF/spring.factories on the class path;
here the generator copies them from the modules into the generated
application.
Constructors
-
SpringFactories([List<
Object> _all = const []]) -
The given factories, in the order of their modules.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
load<
T extends Object> () → List< T> -
Every factory of type
T: byOrdered, else in the order of the modules. Empty when no starter has one. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited