if (structureState == null
|| structureState.hasStructuralChanges(resource, ITypeStructureCache.FLAG_ANNOTATION
| ITypeStructureCache.FLAG_ANNOTATION_VALUE)) {
for (IBean bean : hierachyState.getBeansByContainingTypes(resource)) {
IBeansConfig beansConfig = BeansModelUtils.getConfig(bean);
resources.add(beansConfig.getElementResource());
if (affectedBeans.containsKey(beansConfig)) {
affectedBeans.get(beansConfig).add(bean);
}
else {
Set<IBean> beans = new LinkedHashSet<IBean>();
beans.add(bean);
affectedBeans.put(beansConfig, beans);
}
}
}
}
else if (BeansCoreUtils.isBeansConfig(resource, true)) {
IBeansConfig beansConfig = (IBeansConfig) BeansModelUtils.getResourceModelElement(resource);
if (beansConfig instanceof IImportedBeansConfig) {
beansConfig = BeansModelUtils.getParentOfClass(beansConfig, IBeansConfig.class);
}
for (IBeansImport beansImport : beansConfig.getImports()) {
for (IImportedBeansConfig importedBeansConfig : beansImport.getImportedBeansConfigs()) {
resources.add(importedBeansConfig.getElementResource());
addBeans(importedBeansConfig);
}
}
resources.add(beansConfig.getElementResource());
addBeans(beansConfig);
}
return resources;
}