"Is it something like that if there are multiple systemFields definitions they're merged into a list?"
Well, yes and no.
The no part, One you can't make more than one bean be called systemFields in Spring. Basically, that id/name, is used in Spring in a Map as a key, so only one "systemFields" key could ever be in a Map. But that isn't your Map in your code. So only one systemFields bean is merged into a List.
So, the yes part. If you did not have @Qualifier there, then Spring will go out and find all the beans of type Map<String, Field> and automatically put them all into a List and do the autowiring.
Mark Spritzler wrote:
So, the yes part. If you did not have @Qualifier there, then Spring will go out and find all the beans of type Map<String, Field> and automatically put them all into a List and do the autowiring.
Thanks for the answer.
The thing I don't get is why the code uses List<Map<String, Field>> instead of Map<String, Field>? Is that a precaution in case somebody specifies multiple maps of the same key and value types?
I guess if @Qualifier is used then Map<String, Field> would suffice and don't need List?