public class

AnnotatedBeanDefinitionReader

extends Object
java.lang.Object
   ↳ org.springframework.context.annotation.AnnotatedBeanDefinitionReader

Class Overview

Convenient adapter for programmatic registration of annotated bean classes. This is an alternative to ClassPathBeanDefinitionScanner, applying the same resolution of annotations but for explicitly registered classes only.

Summary

Public Constructors
AnnotatedBeanDefinitionReader(BeanDefinitionRegistry registry)
Create a new AnnotatedBeanDefinitionReader for the given bean factory.
Public Methods
final BeanDefinitionRegistry getRegistry()
Return the BeanDefinitionRegistry that this scanner operates on.
void register(Class...<?> annotatedClasses)
void registerBean(Class<?> annotatedClass, String name, Class...<? extends Annotation> qualifiers)
void registerBean(Class<?> annotatedClass, Class...<? extends Annotation> qualifiers)
void registerBean(Class<?> annotatedClass)
void setBeanNameGenerator(BeanNameGenerator beanNameGenerator)
Set the BeanNameGenerator to use for detected bean classes.
void setEnvironment(Environment environment)
Set the Environment to use when evaluating whether @Profile-annotated component classes should be registered.
void setScopeMetadataResolver(ScopeMetadataResolver scopeMetadataResolver)
Set the ScopeMetadataResolver to use for detected bean classes.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public AnnotatedBeanDefinitionReader (BeanDefinitionRegistry registry)

Create a new AnnotatedBeanDefinitionReader for the given bean factory.

Parameters
registry the BeanFactory to load bean definitions into, in the form of a BeanDefinitionRegistry

Public Methods

public final BeanDefinitionRegistry getRegistry ()

Return the BeanDefinitionRegistry that this scanner operates on.

public void register (Class...<?> annotatedClasses)

public void registerBean (Class<?> annotatedClass, String name, Class...<? extends Annotation> qualifiers)

public void registerBean (Class<?> annotatedClass, Class...<? extends Annotation> qualifiers)

public void registerBean (Class<?> annotatedClass)

public void setBeanNameGenerator (BeanNameGenerator beanNameGenerator)

Set the BeanNameGenerator to use for detected bean classes.

The default is a AnnotationBeanNameGenerator.

public void setEnvironment (Environment environment)

Set the Environment to use when evaluating whether @Profile-annotated component classes should be registered.

The default is a DefaultEnvironment.

See Also
  • #registerBean(Class, String, Class...)

public void setScopeMetadataResolver (ScopeMetadataResolver scopeMetadataResolver)

Set the ScopeMetadataResolver to use for detected bean classes.

The default is an AnnotationScopeMetadataResolver.