接口的使用
org.springframework.beans.factory.support.BeanNameGenerator
使用BeanNameGenerator的程序包 程序包 说明 org.springframework.beans.factory.support Classes supporting theorg.springframework.beans.factory
package.org.springframework.context.annotation Annotation support for the Application Context, including JSR-250 "common" annotations, component-scanning, and Java-based metadata for creating Spring-managed objects.org.springframework.web.context.support Classes supporting theorg.springframework.web.context
package, such as WebApplicationContext implementations and various utility classes.org.springframework.beans.factory.support中BeanNameGenerator的使用
实现BeanNameGenerator的org.springframework.beans.factory.support中的类 修饰符和类型 类 说明 class
DefaultBeanNameGenerator
Default implementation of theBeanNameGenerator
interface, delegating toBeanDefinitionReaderUtils.generateBeanName(BeanDefinition, BeanDefinitionRegistry)
.返回BeanNameGenerator的org.springframework.beans.factory.support中的方法 修饰符和类型 方法 说明 BeanNameGenerator
AbstractBeanDefinitionReader. getBeanNameGenerator()
BeanNameGenerator
BeanDefinitionReader. getBeanNameGenerator()
Return the BeanNameGenerator to use for anonymous beans (without explicit bean name specified).参数类型为BeanNameGenerator的org.springframework.beans.factory.support中的方法 修饰符和类型 方法 说明 void
AbstractBeanDefinitionReader. setBeanNameGenerator(BeanNameGenerator beanNameGenerator)
Set the BeanNameGenerator to use for anonymous beans (without explicit bean name specified).org.springframework.context.annotation中BeanNameGenerator的使用
实现BeanNameGenerator的org.springframework.context.annotation中的类 修饰符和类型 类 说明 class
AnnotationBeanNameGenerator
BeanNameGenerator
implementation for bean classes annotated with the@Component
annotation or with another annotation that is itself annotated with@Component
as a meta-annotation.class
FullyQualifiedAnnotationBeanNameGenerator
An extension ofAnnotationBeanNameGenerator
that uses the fully qualified class name as the default bean name if an explicit bean name is not supplied via a supported type-level annotation such as@Component
(seeAnnotationBeanNameGenerator
for details on supported annotations).返回变量类型为BeanNameGenerator的类型的org.springframework.context.annotation中的方法 修饰符和类型 方法 说明 Class<? extends BeanNameGenerator>
nameGenerator()
TheBeanNameGenerator
class to be used for naming detected components within the Spring container.参数类型为BeanNameGenerator的org.springframework.context.annotation中的方法 修饰符和类型 方法 说明 default void
ImportBeanDefinitionRegistrar. registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry, BeanNameGenerator importBeanNameGenerator)
Register bean definitions as necessary based on the given annotation metadata of the importing@Configuration
class.void
AnnotatedBeanDefinitionReader. setBeanNameGenerator(BeanNameGenerator beanNameGenerator)
Set theBeanNameGenerator
to use for detected bean classes.void
AnnotationConfigApplicationContext. setBeanNameGenerator(BeanNameGenerator beanNameGenerator)
Provide a customBeanNameGenerator
for use withAnnotatedBeanDefinitionReader
and/orClassPathBeanDefinitionScanner
, if any.void
ClassPathBeanDefinitionScanner. setBeanNameGenerator(BeanNameGenerator beanNameGenerator)
Set the BeanNameGenerator to use for detected bean classes.void
ConfigurationClassPostProcessor. setBeanNameGenerator(BeanNameGenerator beanNameGenerator)
Set theBeanNameGenerator
to be used when triggering component scanning fromConfiguration
classes and when registeringImport
'ed configuration classes.org.springframework.web.context.support中BeanNameGenerator的使用
返回BeanNameGenerator的org.springframework.web.context.support中的方法 修饰符和类型 方法 说明 protected BeanNameGenerator
AnnotationConfigWebApplicationContext. getBeanNameGenerator()
Return the customBeanNameGenerator
for use withAnnotatedBeanDefinitionReader
and/orClassPathBeanDefinitionScanner
, if any.参数类型为BeanNameGenerator的org.springframework.web.context.support中的方法 修饰符和类型 方法 说明 void
AnnotationConfigWebApplicationContext. setBeanNameGenerator(BeanNameGenerator beanNameGenerator)
Set a customBeanNameGenerator
for use withAnnotatedBeanDefinitionReader
and/orClassPathBeanDefinitionScanner
.