|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.context.annotation.AnnotatedBeanDefinitionReader
public 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.
AnnotationConfigApplicationContext.register(java.lang.Class>...)
Field Summary | |
---|---|
private BeanNameGenerator |
beanNameGenerator
|
private BeanDefinitionRegistry |
registry
|
private ScopeMetadataResolver |
scopeMetadataResolver
|
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(java.lang.Class<?>... annotatedClasses)
|
void |
registerBean(java.lang.Class<?> annotatedClass)
|
void |
registerBean(java.lang.Class<?> annotatedClass,
java.lang.Class<? extends java.lang.annotation.Annotation>... qualifiers)
|
void |
registerBean(java.lang.Class<?> annotatedClass,
java.lang.String name,
java.lang.Class<? extends java.lang.annotation.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 |
Field Detail |
---|
private final BeanDefinitionRegistry registry
private BeanNameGenerator beanNameGenerator
private ScopeMetadataResolver scopeMetadataResolver
Constructor Detail |
---|
public AnnotatedBeanDefinitionReader(BeanDefinitionRegistry registry)
registry
- the BeanFactory to load bean definitions into,
in the form of a BeanDefinitionRegistryMethod Detail |
---|
public final BeanDefinitionRegistry getRegistry()
public void setBeanNameGenerator(BeanNameGenerator beanNameGenerator)
Default is a AnnotationBeanNameGenerator
.
public void setScopeMetadataResolver(ScopeMetadataResolver scopeMetadataResolver)
The default is an AnnotationScopeMetadataResolver
.
public void register(java.lang.Class<?>... annotatedClasses)
public void registerBean(java.lang.Class<?> annotatedClass)
public void registerBean(java.lang.Class<?> annotatedClass, java.lang.Class<? extends java.lang.annotation.Annotation>... qualifiers)
public void registerBean(java.lang.Class<?> annotatedClass, java.lang.String name, java.lang.Class<? extends java.lang.annotation.Annotation>... qualifiers)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |