Top Description Inners Fields Constructors Methods
org.springframework.context.annotation

public Class ConfigurationClassPostProcessor

extends Object
implements BeanDefinitionRegistryPostProcessor, BeanRegistrationAotProcessor, BeanFactoryInitializationAotProcessor, PriorityOrdered, ResourceLoaderAware, ApplicationStartupAware, BeanClassLoaderAware, EnvironmentAware
Class Inheritance
All Implemented Interfaces
org.springframework.context.EnvironmentAware, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.context.ApplicationStartupAware, org.springframework.context.ResourceLoaderAware, org.springframework.core.PriorityOrdered, org.springframework.core.Ordered, org.springframework.beans.factory.aot.BeanFactoryInitializationAotProcessor, org.springframework.beans.factory.aot.BeanRegistrationAotProcessor, org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor, org.springframework.beans.factory.config.BeanFactoryPostProcessor
Imports
java.io.IOException, .UncheckedIOException, java.lang.reflect.Constructor, .Executable, java.util.ArrayList, .HashMap, .HashSet, .LinkedHashMap, .LinkedHashSet, .List, .Map, .Set, java.util.function.Function, .Predicate, .Supplier, javax.lang.model.element.Modifier, org.apache.commons.logging.Log, .LogFactory, org.springframework.aop.framework.autoproxy.AutoProxyUtils, org.springframework.aot.generate.GeneratedMethod, .GenerationContext, org.springframework.aot.hint.ExecutableMode, .MemberCategory, .ResourceHints, .RuntimeHints, .TypeReference, org.springframework.beans.PropertyValues, org.springframework.beans.factory.BeanClassLoaderAware, .BeanDefinitionStoreException, .BeanFactory, org.springframework.beans.factory.annotation.AnnotatedBeanDefinition, org.springframework.beans.factory.aot.BeanFactoryInitializationAotContribution, .BeanFactoryInitializationAotProcessor, .BeanFactoryInitializationCode, .BeanRegistrationAotContribution, .BeanRegistrationAotProcessor, .BeanRegistrationCode, .BeanRegistrationCodeFragments, .BeanRegistrationCodeFragmentsDecorator, .InstanceSupplierCodeGenerator, org.springframework.beans.factory.config.BeanDefinition, .BeanDefinitionHolder, .BeanFactoryPostProcessor, .ConfigurableListableBeanFactory, .InstantiationAwareBeanPostProcessor, .SingletonBeanRegistry, org.springframework.beans.factory.parsing.FailFastProblemReporter, .PassThroughSourceExtractor, .ProblemReporter, .SourceExtractor, org.springframework.beans.factory.support.AbstractBeanDefinition, .BeanDefinitionRegistry, .BeanDefinitionRegistryPostProcessor, .BeanNameGenerator, .DefaultListableBeanFactory, .RegisteredBean, .RootBeanDefinition, org.springframework.context.ApplicationStartupAware, .EnvironmentAware, .ResourceLoaderAware, org.springframework.context.annotation.ConfigurationClassEnhancer.EnhancedConfiguration, org.springframework.core.Ordered, .PriorityOrdered, org.springframework.core.env.ConfigurableEnvironment, .Environment, .StandardEnvironment, org.springframework.core.io.ClassPathResource, .DefaultResourceLoader, .Resource, .ResourceLoader, org.springframework.core.io.support.PropertySourceDescriptor, .PropertySourceProcessor, .ResourcePatternResolver, org.springframework.core.metrics.ApplicationStartup, .StartupStep, org.springframework.core.type.AnnotationMetadata, .MethodMetadata, org.springframework.core.type.classreading.CachingMetadataReaderFactory, .MetadataReaderFactory, org.springframework.javapoet.CodeBlock, .CodeBlock.Builder, .MethodSpec, .ParameterizedTypeName, org.springframework.lang.Nullable, org.springframework.util.Assert, .ClassUtils, .CollectionUtils

BeanFactoryPostProcessor used for bootstrapping processing of @Configuration classes.

Registered by default when using <context:annotation-config/> or <context:component-scan/>. Otherwise, may be declared manually as with any other BeanFactoryPostProcessor.

This post processor is priority-ordered as it is important that any @Bean methods declared in @Configuration classes have their corresponding bean definitions registered before any other BeanFactoryPostProcessor executes.

Authors
Chris Beams, Juergen Hoeller, Phillip Webb, Sam Brannen
Since
3.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static class
private static class

Field Summary

Modifier and TypeField and Description
private ApplicationStartup
private ClassLoader
private BeanNameGenerator
private Environment
private final Set<Integer>
public static final AnnotationBeanNameGenerator
IMPORT_BEAN_NAME_GENERATOR

A BeanNameGenerator using fully qualified class names as default bean names.

private static final String
private BeanNameGenerator
private boolean
private final Log
private MetadataReaderFactory
private ProblemReporter
private List<PropertySourceDescriptor>
private ConfigurationClassBeanDefinitionReader
private final Set<Integer>
private ResourceLoader
private boolean
private SourceExtractor

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
enhanceConfigurationClasses(ConfigurableListableBeanFactory beanFactory)

Post-processes a BeanFactory in search of Configuration class BeanDefinitions; any candidates are then enhanced by a ConfigurationClassEnhancer.

public int
getOrder()

Implements org.springframework.core.Ordered.getOrder.

Get the order value of this object.

public void
postProcessBeanDefinitionRegistry(BeanDefinitionRegistry
the bean definition registry used by the application context
registry
)

Implements org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor.postProcessBeanDefinitionRegistry.

Derive further bean definitions from the configuration classes in the registry.

public void
postProcessBeanFactory(ConfigurableListableBeanFactory
the bean factory used by the application context
beanFactory
)

Overrides default org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor.postProcessBeanFactory.

Prepare the Configuration classes for servicing bean requests at runtime by replacing them with CGLIB-enhanced subclasses.

public BeanRegistrationAotContribution
processAheadOfTime(RegisteredBean
the registered bean to process
registeredBean
)

Implements org.springframework.beans.factory.aot.BeanRegistrationAotProcessor.processAheadOfTime.

Process the given RegisteredBean instance ahead-of-time and return a contribution or null.

public BeanFactoryInitializationAotContribution
processAheadOfTime(ConfigurableListableBeanFactory
the bean factory to process
beanFactory
)

Implements org.springframework.beans.factory.aot.BeanFactoryInitializationAotProcessor.processAheadOfTime.

Process the given ConfigurableListableBeanFactory instance ahead-of-time and return a contribution or null.

public void
processConfigBeanDefinitions(BeanDefinitionRegistry registry)

Build and validate a configuration model based on the registry of Configuration classes.

private Resource
public void
setApplicationStartup(ApplicationStartup
application startup to be used by this object
applicationStartup
)

Implements org.springframework.context.ApplicationStartupAware.setApplicationStartup.

Set the ApplicationStartup that this object runs with.

public void
setBeanClassLoader(ClassLoader
the owning class loader
beanClassLoader
)

Implements org.springframework.beans.factory.BeanClassLoaderAware.setBeanClassLoader.

Callback that supplies the bean class loader to a bean instance.

public void
setBeanNameGenerator(BeanNameGenerator beanNameGenerator)

Set the BeanNameGenerator to be used when triggering component scanning from Configuration classes and when registering Import'ed configuration classes.

public void
setEnvironment(Environment environment)

Implements org.springframework.context.EnvironmentAware.setEnvironment.

Set the Environment that this component runs in.

public void
public void
setProblemReporter(ProblemReporter problemReporter)

Set the ProblemReporter to use.

public void
setResourceLoader(ResourceLoader
the ResourceLoader object to be used by this object
resourceLoader
)

Implements org.springframework.context.ResourceLoaderAware.setResourceLoader.

Set the ResourceLoader that this object runs in.

This might be a ResourcePatternResolver, which can be checked through instanceof ResourcePatternResolver.

public void
setSourceExtractor(SourceExtractor sourceExtractor)

Set the SourceExtractor to use for generated bean definitions that correspond to Bean factory methods.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait