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

public final Class ImportAwareAotBeanPostProcessor

extends Object
implements BeanPostProcessor, PriorityOrdered
Class Inheritance
All Implemented Interfaces
org.springframework.core.PriorityOrdered, org.springframework.core.Ordered, org.springframework.beans.factory.config.BeanPostProcessor
Imports
java.io.IOException, java.util.Map, org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.core.Ordered, .PriorityOrdered, org.springframework.core.type.classreading.CachingMetadataReaderFactory, .MetadataReader, .MetadataReaderFactory, org.springframework.lang.Nullable, org.springframework.util.ClassUtils

A BeanPostProcessor that honours ImportAware callback using a mapping computed at build time.
Author
Stephane Nicoll
Since
6.0

Field Summary

Modifier and TypeField and Description
private final Map<String, String>
private final MetadataReaderFactory

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private String
public int
getOrder()

Implements org.springframework.core.Ordered.getOrder.

Get the order value of this object.
public Object
postProcessBeforeInitialization(Object
the new bean instance
bean
,
String
the name of the bean
beanName
)

Overrides default org.springframework.beans.factory.config.BeanPostProcessor.postProcessBeforeInitialization.

Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

importsMappingback to summary
private final Map<String, String> importsMapping
metadataReaderFactoryback to summary
private final MetadataReaderFactory metadataReaderFactory

Constructor Detail

ImportAwareAotBeanPostProcessorback to summary
public ImportAwareAotBeanPostProcessor(Map<String, String> importsMapping)

Method Detail

getImportingClassForback to summary
private String getImportingClassFor(ImportAware instance)
Annotations
@Nullable
getOrderback to summary
public int getOrder()

Implements org.springframework.core.Ordered.getOrder.

Doc from org.springframework.core.Ordered.getOrder.

Get the order value of this object.

Higher values are interpreted as lower priority. As a consequence, the object with the lowest value has the highest priority (somewhat analogous to Servlet load-on-startup values).

Same order values will result in arbitrary sort positions for the affected objects.

Returns:int

the order value

Annotations
@Override
postProcessBeforeInitializationback to summary
public Object postProcessBeforeInitialization(Object bean, String beanName)

Overrides default org.springframework.beans.factory.config.BeanPostProcessor.postProcessBeforeInitialization.

Doc from org.springframework.beans.factory.config.BeanPostProcessor.postProcessBeforeInitialization.

Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

The default implementation returns the given bean as-is.

Parameters
bean:Object

the new bean instance

beanName:String

the name of the bean

Returns:Object

the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked

Annotations
@Override
setAnnotationMetadataback to summary
private void setAnnotationMetadata(ImportAware instance)