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 {}

Constructors

Import(List<Type> value)
Imports the classes value.
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
value → List<Type>
Configuration or component classes, BeanRegistrars, ImportSelectors and ImportBeanDefinitionRegistrars.
final

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