open class AnnotatedBeanDefinitionReader
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.
Author
Juergen Hoeller
Author
Chris Beams
Author
Sam Brannen
Author
Phillip Webb
Since
3.0
See Also
AnnotationConfigApplicationContext#register
AnnotatedBeanDefinitionReader(registry: BeanDefinitionRegistry)
Create a new AnnotatedBeanDefinitionReader(registry: BeanDefinitionRegistry, environment: Environment)
Create a new |
fun getRegistry(): BeanDefinitionRegistry
Return the BeanDefinitionRegistry that this scanner operates on. |
|
open fun register(vararg annotatedClasses: Class<*>): Unit
Register one or more annotated classes to be processed. Calls to |
|
open fun registerBean(annotatedClass: Class<*>): Unitopen fun registerBean(annotatedClass: Class<*>, vararg qualifiers: Class<out Annotation>): Unitopen fun registerBean(annotatedClass: Class<*>, name: String, vararg qualifiers: Class<out Annotation>): Unit
Register a bean from the given bean class, deriving its metadata from class-declared annotations. open fun <T : Any> registerBean(annotatedClass: Class<T>, instanceSupplier: Supplier<T>): Unitopen fun <T : Any> registerBean(annotatedClass: Class<T>, name: String, instanceSupplier: Supplier<T>): Unit
Register a bean from the given bean class, deriving its metadata from class-declared annotations, using the given supplier for obtaining a new instance (possibly declared as a lambda expression or method reference). |
|
open fun setBeanNameGenerator(beanNameGenerator: BeanNameGenerator): Unit
Set the BeanNameGenerator to use for detected bean classes. The default is a AnnotationBeanNameGenerator. |
|
open fun setEnvironment(environment: Environment): Unit
Set the Environment to use when evaluating whether Conditional-annotated component classes should be registered. The default is a StandardEnvironment. |
|
open fun setScopeMetadataResolver(scopeMetadataResolver: ScopeMetadataResolver): Unit
Set the ScopeMetadataResolver to use for detected bean classes. The default is an AnnotationScopeMetadataResolver. |