I normally just @Autowire things into spring objects. But I\'ve encountered a situation where I need to dynamically create some objects which require values that could be au
@Service
public class Foo {
@Autowired private AutowireCapableBeanFactory factory;
private <T> T createAutowiredObject(Class<T> c) {
return factory.createBean(c);
}
...
}