private BeanDefinitionRegistry createRegistry(IBeansConfig config, IResourceModelElement contextElement,
boolean fillCompletely) {
DefaultBeanDefinitionRegistry registry = new DefaultBeanDefinitionRegistry();
if (contextElement instanceof BeansConfigSet) {
IBeansConfigSet configSet = (IBeansConfigSet) contextElement;
if (fillCompletely) {
registry.setAllowAliasOverriding(true);
registry.setAllowBeanDefinitionOverriding(true);
}
else {
registry.setAllowAliasOverriding(configSet.isAllowAliasOverriding());
registry.setAllowBeanDefinitionOverriding(configSet.isAllowBeanDefinitionOverriding());
}
for (IBeansConfig csConfig : configSet.getConfigs()) {
if (!fillCompletely && config.equals(csConfig)) {
break;
}
BeansModelUtils.register(configSet, csConfig, registry);
}