当前页面:
在线文档首页 >
Spring Framework 2.1.0 API 文档英文版
ComponentBeanNameGenerator (Spring Framework API 2.1) - Spring Framework 2.1.0 API 文档英文版
org.springframework.context.annotation
Class ComponentBeanNameGenerator
java.lang.Object
org.springframework.context.annotation.ComponentBeanNameGenerator
- All Implemented Interfaces:
- BeanNameGenerator
public class ComponentBeanNameGenerator
- extends Object
- implements BeanNameGenerator
BeanNameGenerator
implementation
for bean classes annotated with the @Component annotation.
If the annotation's value doesn't indicate a bean name, an appropriate name
will be built based on the short name of the class (with the first letter
lower-cased). For example:
com.xyz.FooServiceImpl -> fooServiceImpl
Note that generated bean names have to be unique, hence the actual
runtime names may have a "#1", "#2", etc suffix appended if the raw
names were not unique already.
- Since:
- 2.1
- Author:
- Mark Fisher, Juergen Hoeller
- See Also:
Component.value()
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ComponentBeanNameGenerator
public ComponentBeanNameGenerator()
generateBeanName
public String generateBeanName(BeanDefinition definition,
BeanDefinitionRegistry registry)
- Description copied from interface:
BeanNameGenerator
- Generate a bean name for the given bean definition.
- Specified by:
generateBeanName
in interface BeanNameGenerator
- Parameters:
definition
- the bean definition to generate a name forregistry
- the bean definition registry that the given definition
is supposed to be registered with
- Returns:
- the generated bean name
Copyright © 2002-2007 The Spring Framework.