Import class
Adds beans that the component scan does not find: configuration classes from elsewhere, or code that registers beans.
Put it on a configuration class. Each listed type is either a
configuration (or component) class outside the scanned directories,
whose beans are added with the importing class, or a class that
registers beans in code: a BeanRegistrar, an ImportSelector (which
returns more modules) or an ImportBeanDefinitionRegistrar. The
generator creates those with their no-argument constructor. Imports
share the importing class's conditions: if the class is skipped, so is
what it imports.
@Configuration()
@Import([LegacyConfig]) // declared outside the scanned directory
class AppConfig {}
Spring (Java):
@Configuration
@Import(LegacyConfig.class)
class AppConfig {}
Properties
Methods
-
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