when I use getBean(\"test\")
I have a class like
@Component
public class TEST {
}
can this bean be loaded?
@Component
annotation uses AnnotationBeanNameGenerator
by default which, if not explicitly given a name, will use Introspector.decapitalize()
method on the bean ClassName to get a name for the bean. Normally a class with name like "Test" will give it bean name "test". But decapitalize
has a curiosity:
This normally means converting the first character from upper case to lower case, but in the (unusual) special case when there is more than one character and both the first and second characters are upper case, we leave it alone.
So your class TEST
will get bean name TEST
.