The problem is to create n beans. The n is determined by a config. And the config is just a simple json file.
{ "bean1" : { "property" : true},
"bean2" : { "property" : false}
}
So when I parse config I get that n = 2 and create 2 beans.
There is a way to dynamically create n beans with BeanFactoryPostProcessor (how to get multiple instances of same bean in spring?)
However, In my case, I need to be able to inject config somehow, parse it and only then create n beans. I don't believe that injection is possible with BeanFactoryPostProcessor