Spring注解之@Import

/**
 * Indicates one or more {@link Configuration @Configuration} classes to import.
 * 表示import 一个或多个class
 * <p>Provides functionality equivalent to the {@code <import/>} element in Spring XML.
* 等同于Spring XML 中的 <import/>的作用 * Allows for importing {
@code @Configuration} classes, {@link ImportSelector} and * {@link ImportBeanDefinitionRegistrar} implementations, as well as regular component * classes (as of 4.2; analogous to {@link AnnotationConfigApplicationContext#register}). * 运行的值类型 @Configuration注解的类,@ImportSelector 和 ImportBeanDefinitionRegistrar的实现类
* * <p>{
@code @Bean} definitions declared in imported {@code @Configuration} classes should be * accessed by using {@link org.springframework.beans.factory.annotation.Autowired @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 {@code @Configuration} class methods. * @Bean声明定义的 @Configuration实现类 通过@Autowired注入的方式访问; 不管是通过autowired 实例化还是通过
* 配置配置类 实例化声明bean. 后一种方法显示通过IDEA友好在各个方法之间导航 * <p>May be declared at the class level or as a meta-annotation. * 可以在类级别声明,也可以作为元注释 * <p>If XML or other non-{
@code @Configuration} bean definition resources need to be * imported, use the {@link ImportResource @ImportResource} annotation instead. * * @author Chris Beams * @author Juergen Hoeller * @since 3.0 * @see Configuration * @see ImportSelector * @see ImportResource */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface Import { /** * {@link Configuration}, {@link ImportSelector}, {@link ImportBeanDefinitionRegistrar} * or regular component classes to import. */ Class<?>[] value(); }

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值