org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver Java Examples
The following examples show how to use
org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: QualifierAnnotationTests.java From spring-analysis-note with MIT License | 6 votes |
@Test public void testQualifiedByAttributesWithCustomQualifierRegistered() { StaticApplicationContext context = new StaticApplicationContext(); BeanDefinitionReader reader = new XmlBeanDefinitionReader(context); reader.loadBeanDefinitions(CONFIG_LOCATION); QualifierAnnotationAutowireCandidateResolver resolver = (QualifierAnnotationAutowireCandidateResolver) context.getDefaultListableBeanFactory().getAutowireCandidateResolver(); resolver.addQualifierType(MultipleAttributeQualifier.class); context.registerSingleton("testBean", MultiQualifierClient.class); context.refresh(); MultiQualifierClient testBean = (MultiQualifierClient) context.getBean("testBean"); assertNotNull( testBean.factoryTheta); assertNotNull( testBean.implTheta); }
Example #2
Source File: QualifierAnnotationTests.java From java-technology-stack with MIT License | 6 votes |
@Test public void testQualifiedByAttributesWithCustomQualifierRegistered() { StaticApplicationContext context = new StaticApplicationContext(); BeanDefinitionReader reader = new XmlBeanDefinitionReader(context); reader.loadBeanDefinitions(CONFIG_LOCATION); QualifierAnnotationAutowireCandidateResolver resolver = (QualifierAnnotationAutowireCandidateResolver) context.getDefaultListableBeanFactory().getAutowireCandidateResolver(); resolver.addQualifierType(MultipleAttributeQualifier.class); context.registerSingleton("testBean", MultiQualifierClient.class); context.refresh(); MultiQualifierClient testBean = (MultiQualifierClient) context.getBean("testBean"); assertNotNull( testBean.factoryTheta); assertNotNull( testBean.implTheta); }
Example #3
Source File: QualifierAnnotationTests.java From spring4-understanding with Apache License 2.0 | 6 votes |
@Test public void testQualifiedByAttributesWithCustomQualifierRegistered() { StaticApplicationContext context = new StaticApplicationContext(); BeanDefinitionReader reader = new XmlBeanDefinitionReader(context); reader.loadBeanDefinitions(CONFIG_LOCATION); QualifierAnnotationAutowireCandidateResolver resolver = (QualifierAnnotationAutowireCandidateResolver) context.getDefaultListableBeanFactory().getAutowireCandidateResolver(); resolver.addQualifierType(MultipleAttributeQualifier.class); context.registerSingleton("testBean", MultiQualifierClient.class); context.refresh(); MultiQualifierClient testBean = (MultiQualifierClient) context.getBean("testBean"); assertNotNull( testBean.factoryTheta); assertNotNull( testBean.implTheta); }
Example #4
Source File: ConfigurationClassPostProcessorTests.java From spring4-understanding with Apache License 2.0 | 5 votes |
@Before public void setUp() { DefaultListableBeanFactory bf = new DefaultListableBeanFactory(); QualifierAnnotationAutowireCandidateResolver acr = new QualifierAnnotationAutowireCandidateResolver(); acr.setBeanFactory(bf); bf.setAutowireCandidateResolver(acr); this.beanFactory = bf; }
Example #5
Source File: ConfigurationClassPostProcessorTests.java From spring-analysis-note with MIT License | 4 votes |
@Before public void setup() { QualifierAnnotationAutowireCandidateResolver acr = new QualifierAnnotationAutowireCandidateResolver(); acr.setBeanFactory(this.beanFactory); this.beanFactory.setAutowireCandidateResolver(acr); }
Example #6
Source File: ConfigurationClassPostProcessorTests.java From java-technology-stack with MIT License | 4 votes |
@Before public void setup() { QualifierAnnotationAutowireCandidateResolver acr = new QualifierAnnotationAutowireCandidateResolver(); acr.setBeanFactory(this.beanFactory); this.beanFactory.setAutowireCandidateResolver(acr); }