private void scanForSections() { logger.debug("Scanning for side bar sections"); String[] beanNames = applicationContext.getBeanNamesForAnnotation(SideBarSection.class); for (String beanName : beanNames) { logger.debug("Bean [{}] declares a side bar section", beanName); addSectionDescriptors(applicationContext.findAnnotationOnBean(beanName, SideBarSection.class)); } beanNames = applicationContext.getBeanNamesForAnnotation(SideBarSections.class); for (String beanName : beanNames) { logger.debug("Bean [{}] declares multiple side bar sections", beanName); addSectionDescriptors(applicationContext.findAnnotationOnBean(beanName, SideBarSections.class).value()); } }