站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 2.1.0 API 文档英文版

ComponentBeanNameGenerator (Spring Framework API 2.1) - Spring Framework 2.1.0 API 文档英文版


The Spring Framework

org.springframework.context.annotation
Class ComponentBeanNameGenerator

java.lang.Object
  extended by 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()

Constructor Summary
ComponentBeanNameGenerator()
           
 
Method Summary
 String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry)
          Generate a bean name for the given bean definition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentBeanNameGenerator

public ComponentBeanNameGenerator()
Method Detail

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 for
registry - the bean definition registry that the given definition is supposed to be registered with
Returns:
the generated bean name

The Spring Framework

Copyright © 2002-2007 The Spring Framework.