org.springframework.context.annotation
Class AnnotatedBeanDefinitionReader

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

public class AnnotatedBeanDefinitionReader
extends Object

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.

Since:
3.0
Author:
Juergen Hoeller
See Also:
AnnotationConfigApplicationContext.register(java.lang.Class...)

Constructor Summary
AnnotatedBeanDefinitionReader(BeanDefinitionRegistry registry)
          Create a new AnnotatedBeanDefinitionReader for the given bean factory.
 
Method Summary
 BeanDefinitionRegistry getRegistry()
          Return the BeanDefinitionRegistry that this scanner operates on.
 void register(Class<?>... annotatedClasses)
           
 void registerBean(Class<?> annotatedClass)
           
 void registerBean(Class<?> annotatedClass, Class<? extends Annotation>... qualifiers)
           
 void registerBean(Class<?> annotatedClass, String name, Class<? extends Annotation>... qualifiers)
           
 void setBeanNameGenerator(BeanNameGenerator beanNameGenerator)
          Set the BeanNameGenerator to use for detected bean classes.
 void setScopeMetadataResolver(ScopeMetadataResolver scopeMetadataResolver)
          Set the ScopeMetadataResolver to use for detected bean classes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotatedBeanDefinitionReader

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
Method Detail

getRegistry

public final BeanDefinitionRegistry getRegistry()
Return the BeanDefinitionRegistry that this scanner operates on.


setBeanNameGenerator

public void setBeanNameGenerator(BeanNameGenerator beanNameGenerator)
Set the BeanNameGenerator to use for detected bean classes.

Default is a AnnotationBeanNameGenerator.


setScopeMetadataResolver

public void setScopeMetadataResolver(ScopeMetadataResolver scopeMetadataResolver)
Set the ScopeMetadataResolver to use for detected bean classes.

The default is an AnnotationScopeMetadataResolver.


register

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

registerBean

public void registerBean(Class<?> annotatedClass)

registerBean

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

registerBean

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