ImportAware

/**
 * Interface to be implemented by any @{@link Configuration} class that wishes
 * to be injected with the {@link AnnotationMetadata} of the @{@code Configuration}
 * class that imported it. Useful in conjunction with annotations that
 * use @{@link Import} as a meta-annotation.
 *
 * @author Chris Beams
 * @since 3.1
 */
public interface ImportAware extends Aware {

    /**
     * Set the annotation metadata of the importing @{@code Configuration} class.
     */
    void setImportMetadata(AnnotationMetadata importMetadata);

}

 

这个类注释不容易翻译,比较拗口,就是说白了实现这个接口,重写setImportMetadata方法,就是用来处理自定义注解的,比如将注解的某些属性值赋值给其他bean的属性。

 

posted @ 2018-05-16 19:27  yangfei969  阅读(530)  评论(0编辑  收藏  举报