Top Description Fields Constructors Methods
org.springframework.beans.factory.annotation

public Class CustomAutowireConfigurer

extends Object
implements BeanFactoryPostProcessor, BeanClassLoaderAware, Ordered
Class Inheritance
All Implemented Interfaces
org.springframework.core.Ordered, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.Aware, org.springframework.beans.factory.config.BeanFactoryPostProcessor
Imports
java.lang.annotation.Annotation, java.util.Set, org.springframework.beans.BeansException, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.config.BeanFactoryPostProcessor, .ConfigurableListableBeanFactory, org.springframework.beans.factory.support.DefaultListableBeanFactory, org.springframework.core.Ordered, org.springframework.lang.Nullable, org.springframework.util.ClassUtils

A org.springframework.beans.factory.config.BeanFactoryPostProcessor implementation that allows for convenient registration of custom autowire qualifier types.
<bean id="customAutowireConfigurer" class="org.springframework.beans.factory.annotation.CustomAutowireConfigurer">
  <property name="customQualifierTypes">
    <set>
      <value>mypackage.MyQualifier</value>
    </set>
  </property>
</bean>
Authors
Mark Fisher, Juergen Hoeller
Since
2.5
See Also
org.springframework.beans.factory.annotation.Qualifier

Field Summary

Modifier and TypeField and Description
private ClassLoader
private Set<?>
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
getOrder()

Implements org.springframework.core.Ordered.getOrder.

Get the order value of this object.

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

Implements org.springframework.beans.factory.config.BeanFactoryPostProcessor.postProcessBeanFactory.

Modify the application context's internal bean factory after its standard initialization.

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
setCustomQualifierTypes(Set<?>
the custom types to register
customQualifierTypes
)

Register custom qualifier annotation types to be considered when autowiring beans.

public void
setOrder(int order)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

beanClassLoaderback to summary
private ClassLoader beanClassLoader
Annotations
@Nullable
customQualifierTypesback to summary
private Set<?> customQualifierTypes
Annotations
@Nullable
orderback to summary
private int order

Constructor Detail

CustomAutowireConfigurerback to summary
public CustomAutowireConfigurer()

Method Detail

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
postProcessBeanFactoryback to summary
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException

Implements org.springframework.beans.factory.config.BeanFactoryPostProcessor.postProcessBeanFactory.

Doc from org.springframework.beans.factory.config.BeanFactoryPostProcessor.postProcessBeanFactory.

Modify the application context's internal bean factory after its standard initialization. All bean definitions will have been loaded, but no beans will have been instantiated yet. This allows for overriding or adding properties even to eager-initializing beans.

Parameters
beanFactory:ConfigurableListableBeanFactory

the bean factory used by the application context

Annotations
@Override
@SuppressWarnings:unchecked
Exceptions
BeansException:
in case of errors
setBeanClassLoaderback to summary
public void setBeanClassLoader(ClassLoader beanClassLoader)

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

Doc from org.springframework.beans.factory.BeanClassLoaderAware.setBeanClassLoader.

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

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean's InitializingBean#afterPropertiesSet() method or a custom init-method.

Parameters
beanClassLoader:ClassLoader

the owning class loader

Annotations
@Override
setCustomQualifierTypesback to summary
public void setCustomQualifierTypes(Set<?> customQualifierTypes)

Register custom qualifier annotation types to be considered when autowiring beans. Each element of the provided set may be either a Class instance or a String representation of the fully-qualified class name of the custom annotation.

Note that any annotation that is itself annotated with Spring's org.springframework.beans.factory.annotation.Qualifier does not require explicit registration.

Parameters
customQualifierTypes:Set<?>

the custom types to register

setOrderback to summary
public void setOrder(int order)