Code example for ClassPathBeanDefinitionScanner

Methods: addIncludeFilter

0
 
    public DevproofClassPathBeanDefinitionScanner(BeanDefinitionRegistry registry, boolean useDefaultFilters, ModuleConfiguration moduleConfiguration) {
        super(registry, useDefaultFilters);
        this.registry = registry;
        this.moduleConfiguration = moduleConfiguration;
        addIncludeFilter(new AnnotationTypeFilter(ModulePage.class));
        addIncludeFilter(new AnnotationTypeFilter(NavigationBox.class));
        addIncludeFilter(new AnnotationTypeFilter(GenericRepository.class));
        addIncludeFilter(new AnnotationTypeFilter(RegisterGenericDataProvider.class));
        addIncludeFilter(new AnnotationTypeFilter(Entity.class));
        addIncludeFilter(new AnnotationTypeFilter(org.hibernate.annotations.Entity.class));
        registerModuleConfigurationAsSingleton(); 
    } 
 
    private void registerModuleConfigurationAsSingleton() { 
        ConfigurableListableBeanFactory f = (ConfigurableListableBeanFactory)registry;
         String basePackage = moduleConfiguration.getBasePackage();
        if(f.containsBean(basePackage)) {
            throw new IllegalStateException("You tried to register a devproof module twice with the same base-package: " + basePackage + "!");   
        } 
Experience pair programming with AI  Get Codota for Java