Spring 获取自定义注解所有类

时间:2025-04-05 08:30:38

import ;
import ;
import ;
import ;
import ;
import ;

import ;
import ;
import ;


public class ComponentScannerConfigurerBk implements ApplicationListener<ContextRefreshedEvent>, ApplicationContextAware {
    private ComponentScannerConfigurer registrationCenter;


    private ApplicationContext applicationContext;
    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
         = applicationContext;
    }

    @Override
    public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
        Class<? extends Annotation> annotationClass = ;
        Map<String,Object> beanWhithAnnotation = (annotationClass);
        Set<<String,Object>> entitySet = ();
        for (<String,Object> entry :entitySet){
            Class<? extends Object> clazz = ().getClass();//获取bean对象
            ("================"+());
            ComponentDesc componentDesc = (clazz,);
            ("==================="+());

        }
    }
}