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

Following code examples demonstrate how to use org.springframework.beans.factory.config.RuntimeBeanNameReference 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.RuntimeBeanNameReference and various code implementation of this class.
Example 1
Project : spring-framework Source File : BeanMetadataElementTest.java View Source Code on GitHub

	public void test() {

		

		

		Object bean = new Object();

		RuntimeBeanNameReference beanMetadataElement = new RuntimeBeanNameReference("name");
		beanMetadataElement.setSource(bean);

		aeqr(bean, beanMetadataElement.getSource());
	}
			
Example 2
Project : spring-framework Source File : PropertyValueParser.java View Source Code on GitHub

	protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
		super.doParse(element, parserContext, builder);
		AbstractBeanDefinition bd = builder.getBeanDefinition();
		MutablePropertyValues propertyValues = bd.getPropertyValues();
		String beanName = element.getAttribute("bean");
		RuntimeBeanNameReference rbnr = new RuntimeBeanNameReference(beanName);
		propertyValues.add("carId", rbnr);
	}
			
Example 3
Project : spring-framework Source File : PropertyValues.java View Source Code on GitHub

    public static void main(String[] args) {
        
        
        
        RuntimeBeanNameReference ref = new RuntimeBeanNameReference("beanName");
        
        RuntimeBeanReference refBean = new RuntimeBeanReference("beanName");
        
        
    }
			
Example 4
Project : spring-framework Source File : BeanDefinationTest.java View Source Code on GitHub

	public static void main(String[] args) {
		RootBeanDefinition bd=new RootBeanDefinition(People.class);
		RuntimeBeanNameReference reference=new RuntimeBeanNameReference("");
		PropertyValue pv=new PropertyValue("", "");
		bd.getPropertyValues().addPropertyValue(pv);
		bd.setSource("");
		
	}
			
Example 5
Project : spring-framework Source File : StaticApplicationContestTest.java View Source Code on GitHub

    public void staticApplicationContextTithDI(){
        StaticApplicationContext applicationContext = new StaticApplicationContext(  );
        applicationContext.registerSingleton( "hello" ,HelloPerson.class);
        BeanDefinition beanDefinition = new RootBeanDefinition( HelloPerson.class );
        beanDefinition.getPropertyValues().addPropertyValue( "name","허윤호" );
        beanDefinition.getPropertyValues().addPropertyValue( "hello",new RuntimeBeanNameReference( "hello" ) );
        applicationContext.registerBeanDefinition( "helloPerson", beanDefinition );
        Hello hello =applicationContext.getBean( "helloPerson", Hello.class );
        assertThat( hello.sayHello(),is("hello!!! 허윤호") );
    }