类 FullyQualifiedAnnotationBeanNameGenerator
- java.lang.Object
- org.springframework.context.annotation.AnnotationBeanNameGenerator
- org.springframework.context.annotation.FullyQualifiedAnnotationBeanNameGenerator
- 所有已实现的接口:
BeanNameGenerator
public class FullyQualifiedAnnotationBeanNameGenerator extends AnnotationBeanNameGenerator
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).Favor this bean naming strategy over
AnnotationBeanNameGenerator
if you run into naming conflicts due to multiple autodetected components having the same non-qualified class name (i.e., classes with identical names but residing in different packages).Note that an instance of this class is used by default for configuration-level import purposes; whereas, the default for component scanning purposes is a plain
AnnotationBeanNameGenerator
.- 从以下版本开始:
- 5.2.3
- 作者:
- Juergen Hoeller, Sam Brannen
- 另请参阅:
DefaultBeanNameGenerator
,AnnotationBeanNameGenerator
,ConfigurationClassPostProcessor.IMPORT_BEAN_NAME_GENERATOR
字段概要
字段 修饰符和类型 字段 说明 static FullyQualifiedAnnotationBeanNameGenerator
INSTANCE
A convenient constant for a defaultFullyQualifiedAnnotationBeanNameGenerator
instance, as used for configuration-level import purposes.
构造器概要
构造器 构造器 说明 FullyQualifiedAnnotationBeanNameGenerator()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected String
buildDefaultBeanName(BeanDefinition definition)
Derive a default bean name from the given bean definition.从类继承的方法 org.springframework.context.annotation.AnnotationBeanNameGenerator
buildDefaultBeanName, determineBeanNameFromAnnotation, generateBeanName, isStereotypeWithNameValue
字段详细资料
INSTANCE
public static final FullyQualifiedAnnotationBeanNameGenerator INSTANCE
A convenient constant for a defaultFullyQualifiedAnnotationBeanNameGenerator
instance, as used for configuration-level import purposes.- 从以下版本开始:
- 5.2.11
构造器详细资料
FullyQualifiedAnnotationBeanNameGenerator
public FullyQualifiedAnnotationBeanNameGenerator()
方法详细资料
buildDefaultBeanName
protected String buildDefaultBeanName(BeanDefinition definition)
从类复制的说明:AnnotationBeanNameGenerator
Derive a default bean name from the given bean definition.The default implementation simply builds a decapitalized version of the short class name: e.g. "mypackage.MyJdbcDao" -> "myJdbcDao".
Note that inner classes will thus have names of the form "outerClassName.InnerClassName", which because of the period in the name may be an issue if you are autowiring by name.
- 覆盖:
buildDefaultBeanName
在类中AnnotationBeanNameGenerator
- 参数:
definition
- the bean definition to build a bean name for- 返回:
- the default bean name (never
null
)