org.springframework.context.annotation
Class ConfigurationClassBeanDefinitionReader

java.lang.Object
  extended by org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader

 class ConfigurationClassBeanDefinitionReader
extends java.lang.Object

Reads a given fully-populated set of ConfigurationClass instances, registering bean definitions with the given BeanDefinitionRegistry based on its contents.

This class was modeled after the BeanDefinitionReader hierarchy, but does not implement/extend any of its artifacts as a set of configuration classes is not a Resource.

Since:
3.0
Author:
Chris Beams, Juergen Hoeller
See Also:
ConfigurationClassParser

Nested Class Summary
private static class ConfigurationClassBeanDefinitionReader.ConfigurationClassBeanDefinition
          RootBeanDefinition marker subclass used to signify that a bean definition was created from a configuration class as opposed to any other configuration source.
private static class ConfigurationClassBeanDefinitionReader.InvalidConfigurationImportProblem
          Configuration classes must be annotated with @Configuration or declare at least one @Bean method.
 
Field Summary
private static Log logger
           
private  MetadataReaderFactory metadataReaderFactory
           
private  ProblemReporter problemReporter
           
private  BeanDefinitionRegistry registry
           
private  ResourceLoader resourceLoader
           
private  SourceExtractor sourceExtractor
           
 
Constructor Summary
ConfigurationClassBeanDefinitionReader(BeanDefinitionRegistry registry, SourceExtractor sourceExtractor, ProblemReporter problemReporter, MetadataReaderFactory metadataReaderFactory, ResourceLoader resourceLoader)
          Create a new ConfigurationClassBeanDefinitionReader instance that will be used to populate the given BeanDefinitionRegistry.
 
Method Summary
private  void doLoadBeanDefinitionForConfigurationClassIfNecessary(ConfigurationClass configClass)
          Register the Configuration class itself as a bean definition.
 void loadBeanDefinitions(java.util.Set<ConfigurationClass> configurationModel)
          Read configurationModel, registering bean definitions with registry based on its contents.
private  void loadBeanDefinitionsForBeanMethod(BeanMethod beanMethod)
          Read the given BeanMethod, registering bean definitions with the BeanDefinitionRegistry based on its contents.
private  void loadBeanDefinitionsForConfigurationClass(ConfigurationClass configClass)
          Read a particular ConfigurationClass, registering bean definitions for the class itself, all its Bean methods
private  void loadBeanDefinitionsFromImportedResources(java.util.Map<java.lang.String,java.lang.Class<?>> importedResources)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final Log logger

registry

private final BeanDefinitionRegistry registry

sourceExtractor

private final SourceExtractor sourceExtractor

problemReporter

private final ProblemReporter problemReporter

metadataReaderFactory

private final MetadataReaderFactory metadataReaderFactory

resourceLoader

private ResourceLoader resourceLoader
Constructor Detail

ConfigurationClassBeanDefinitionReader

public ConfigurationClassBeanDefinitionReader(BeanDefinitionRegistry registry,
                                              SourceExtractor sourceExtractor,
                                              ProblemReporter problemReporter,
                                              MetadataReaderFactory metadataReaderFactory,
                                              ResourceLoader resourceLoader)
Create a new ConfigurationClassBeanDefinitionReader instance that will be used to populate the given BeanDefinitionRegistry.

Parameters:
problemReporter -
metadataReaderFactory -
Method Detail

loadBeanDefinitions

public void loadBeanDefinitions(java.util.Set<ConfigurationClass> configurationModel)
Read configurationModel, registering bean definitions with registry based on its contents.


loadBeanDefinitionsForConfigurationClass

private void loadBeanDefinitionsForConfigurationClass(ConfigurationClass configClass)
Read a particular ConfigurationClass, registering bean definitions for the class itself, all its Bean methods


doLoadBeanDefinitionForConfigurationClassIfNecessary

private void doLoadBeanDefinitionForConfigurationClassIfNecessary(ConfigurationClass configClass)
Register the Configuration class itself as a bean definition.


loadBeanDefinitionsForBeanMethod

private void loadBeanDefinitionsForBeanMethod(BeanMethod beanMethod)
Read the given BeanMethod, registering bean definitions with the BeanDefinitionRegistry based on its contents.


loadBeanDefinitionsFromImportedResources

private void loadBeanDefinitionsFromImportedResources(java.util.Map<java.lang.String,java.lang.Class<?>> importedResources)