Class AnnotationBeanNameGenerator

    • Field Detail

      • INSTANCE

        public static final AnnotationBeanNameGenerator INSTANCE
        A convenient constant for a default AnnotationBeanNameGenerator instance, as used for component scanning purposes.
        Since:
        5.2
    • Method Detail

      • isStereotypeWithNameValue

        protected boolean isStereotypeWithNameValue​(String annotationType,
                                                    Set<String> metaAnnotationTypes,
                                                    @Nullable
                                                    Map<String,​Object> attributes)
        Check whether the given annotation is a stereotype that is allowed to suggest a component name through its annotation value().
        Parameters:
        annotationType - the name of the annotation class to check
        metaAnnotationTypes - the names of meta-annotations on the given annotation
        attributes - the map of attributes for the given annotation
        Returns:
        whether the annotation qualifies as a stereotype with component name
      • buildDefaultBeanName

        protected String buildDefaultBeanName​(BeanDefinition definition)
        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.

        Parameters:
        definition - the bean definition to build a bean name for
        Returns:
        the default bean name (never null)