org.springframework.context.annotation
Annotation Type Import


@Target(value=TYPE)
@Retention(value=RUNTIME)
@Documented
public @interface Import

Indicates one or more @Configuration classes to import.

Provides functionality equivalent to the <import/> element in Spring XML. Only supported for classes annotated with @Configuration or declaring at least one @Bean method, as well as ImportSelector and ImportBeanDefinitionRegistrar implementations.

@Bean definitions declared in imported @Configuration classes should be accessed by using @Autowired injection. Either the bean itself can be autowired, or the configuration class instance declaring the bean can be autowired. The latter approach allows for explicit, IDE-friendly navigation between @Configuration class methods.

May be declared at the class level or as a meta-annotation.

If XML or other non-@Configuration bean definition resources need to be imported, use @ImportResource

Since:
3.0
Author:
Chris Beams
See Also:
Configuration, ImportSelector, ImportResource

Required Element Summary
 Class<?>[] value
          The @Configuration, ImportSelector and/or ImportBeanDefinitionRegistrar classes to import.
 

Element Detail

value

public abstract Class<?>[] value
The @Configuration, ImportSelector and/or ImportBeanDefinitionRegistrar classes to import.