title: How to programmatically create bean definition with injected properties?
body: <p>I want to programmatically add a bean definition to an application context, but some properties of that definition are other beans from that context (I know their names). How can I do this so that those properties will be injected?</p>
  
  <p>For example:</p>
  
  <pre><code>GenericBeanDefinition beanDef = new GenericBeanDefinition();
  beanDef.setBeanClass(beanClass);
  
  MutablePropertyValues values = new MutablePropertyValues();
  values.addPropertyValue("intProperty", 10);
  values.addPropertyValue("stringProperty", "Hello, world");
  values.addPropertyValue("beanProperty", /* What should be here? */);
  
  beanDef.setPropertyValues(values);
  </code></pre>
  
  <p>I'm using Spring 3.0.</p>