Examples of applyBeanPropertyValues()


Examples of org.springframework.beans.factory.config.AutowireCapableBeanFactory.applyBeanPropertyValues()

                view = (AbstractThymeleafView) beanFactory.configureBean(view, viewName);
            } else {
                // The AUTOWIRE_NO mode applies autowiring only through annotations
                beanFactory.autowireBeanProperties(view, AutowireCapableBeanFactory.AUTOWIRE_NO, false);
                // A bean with this name exists, so we apply its properties
                beanFactory.applyBeanPropertyValues(view, viewName);
                // Finally, we let Spring do the remaining initializations (incl. proxifying if needed)
                view = (AbstractThymeleafView) beanFactory.initializeBean(view, viewName);
            }
        } else {
            // The AUTOWIRE_NO mode applies autowiring only through annotations
View Full Code Here

Examples of org.springframework.beans.factory.config.AutowireCapableBeanFactory.applyBeanPropertyValues()

                view = (AbstractThymeleafView) beanFactory.configureBean(view, viewName);
            } else {
                // The AUTOWIRE_NO mode applies autowiring only through annotations
                beanFactory.autowireBeanProperties(view, AutowireCapableBeanFactory.AUTOWIRE_NO, false);
                // A bean with this name exists, so we apply its properties
                beanFactory.applyBeanPropertyValues(view, viewName);
                // Finally, we let Spring do the remaining initializations (incl. proxifying if needed)
                view = (AbstractThymeleafView) beanFactory.initializeBean(view, viewName);
            }
        } else {
            // The AUTOWIRE_NO mode applies autowiring only through annotations
View Full Code Here

Examples of org.springframework.beans.factory.support.DefaultListableBeanFactory.applyBeanPropertyValues()

    MutablePropertyValues pvs = new MutablePropertyValues();
    pvs.addPropertyValue("age", "99");
    lbf.registerBeanDefinition("test", new RootBeanDefinition(TestBean.class, pvs));
    TestBean tb = new TestBean();
    assertEquals(0, tb.getAge());
    lbf.applyBeanPropertyValues(tb, "test");
    assertEquals(99, tb.getAge());
  }

  public void testApplyBeanPropertyValuesWithIncompleteDefinition() {
    DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
View Full Code Here

Examples of org.springframework.beans.factory.support.DefaultListableBeanFactory.applyBeanPropertyValues()

    MutablePropertyValues pvs = new MutablePropertyValues();
    pvs.addPropertyValue("age", "99");
    lbf.registerBeanDefinition("test", new RootBeanDefinition(null, pvs));
    TestBean tb = new TestBean();
    assertEquals(0, tb.getAge());
    lbf.applyBeanPropertyValues(tb, "test");
    assertEquals(99, tb.getAge());
    assertNull(tb.getBeanFactory());
    assertNull(tb.getSpouse());
  }
View Full Code Here

Examples of org.springframework.beans.factory.support.DefaultListableBeanFactory.applyBeanPropertyValues()

    RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
    bd.setPropertyValues(pvs);
    lbf.registerBeanDefinition("test", bd);
    TestBean tb = new TestBean();
    assertEquals(0, tb.getAge());
    lbf.applyBeanPropertyValues(tb, "test");
    assertEquals(99, tb.getAge());
  }

  @Test
  public void testApplyBeanPropertyValuesWithIncompleteDefinition() {
View Full Code Here

Examples of org.springframework.beans.factory.support.DefaultListableBeanFactory.applyBeanPropertyValues()

    RootBeanDefinition bd = new RootBeanDefinition();
    bd.setPropertyValues(pvs);
    lbf.registerBeanDefinition("test", bd);
    TestBean tb = new TestBean();
    assertEquals(0, tb.getAge());
    lbf.applyBeanPropertyValues(tb, "test");
    assertEquals(99, tb.getAge());
    assertNull(tb.getBeanFactory());
    assertNull(tb.getSpouse());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.