Java Code Examples for org.springframework.beans.factory.config.BeanDefinitionVisitor

Following code examples demonstrate how to use org.springframework.beans.factory.config.BeanDefinitionVisitor from spring-framework. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use org.springframework.beans.factory.config.BeanDefinitionVisitor and various code implementation of this class.
Example 1
Project : spring-framework Source File : MyBeanFactoryPostProcessor.java View Source Code on GitHub

                public String resolveStringValue(String strVal) {


                    if (strVal.contains("shit")) {

                        System.out.println("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");

                        return "shit*****";
                    }
                    return strVal;
                }
			
Example 2
Project : spring-framework Source File : CustomBeanFactoryPostProcessor.java View Source Code on GitHub

    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {


        String[] beanNames = beanFactory.getBeanDefinitionNames();
        for (String beanName : beanNames) {
            BeanDefinition bd = beanFactory.getBeanDefinition(beanName);
            BeanDefinitionVisitor visitor = new BeanDefinitionVisitor(valueResolver);
            visitor.visitBeanDefinition(bd);
        }

    }
			
Example 3
Project : spring-framework Source File : ShieldNogoodWordProcessor.java View Source Code on GitHub

    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
        String [] beanNames = beanFactory.getBeanDefinitionNames();
        for(String beanName: beanNames){
            BeanDefinition beanDefinition = beanFactory.getBeanDefinition(beanName);
            BeanDefinitionVisitor visitor = new BeanDefinitionVisitor(str->{
                if(str.equals("宇宙")){
                    return "aaaaa";
                }else{
                    return str;
                }
            }
            );
            visitor.visitBeanDefinition(beanDefinition);
        }
    }
			
Example 4
Project : spring-framework Source File : ObscenityRemovingBeanFactoryProcessor.java View Source Code on GitHub

                public String resolveStringValue(String strVal) {
                    if (isObscene(strVal)) {
                        return "*******";
                    } else {
                        return strVal;
                    }
                }