Improve documentation for FullyQualifiedAnnotationBeanNameGenerator
See gh-24114
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -116,11 +116,13 @@ public class AnnotationConfigApplicationContext extends GenericApplicationContex
|
||||
/**
|
||||
* Provide a custom {@link BeanNameGenerator} for use with {@link AnnotatedBeanDefinitionReader}
|
||||
* and/or {@link ClassPathBeanDefinitionScanner}, if any.
|
||||
* <p>Default is {@link org.springframework.context.annotation.AnnotationBeanNameGenerator}.
|
||||
* <p>Default is {@link AnnotationBeanNameGenerator}.
|
||||
* <p>Any call to this method must occur prior to calls to {@link #register(Class...)}
|
||||
* and/or {@link #scan(String...)}.
|
||||
* @see AnnotatedBeanDefinitionReader#setBeanNameGenerator
|
||||
* @see ClassPathBeanDefinitionScanner#setBeanNameGenerator
|
||||
* @see AnnotationBeanNameGenerator
|
||||
* @see FullyQualifiedAnnotationBeanNameGenerator
|
||||
*/
|
||||
public void setBeanNameGenerator(BeanNameGenerator beanNameGenerator) {
|
||||
this.reader.setBeanNameGenerator(beanNameGenerator);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -94,6 +94,8 @@ public @interface ComponentScan {
|
||||
* {@link AnnotationBeanNameGenerator} or any custom instance supplied to the
|
||||
* application context at bootstrap time.
|
||||
* @see AnnotationConfigApplicationContext#setBeanNameGenerator(BeanNameGenerator)
|
||||
* @see AnnotationBeanNameGenerator
|
||||
* @see FullyQualifiedAnnotationBeanNameGenerator
|
||||
*/
|
||||
Class<? extends BeanNameGenerator> nameGenerator() default BeanNameGenerator.class;
|
||||
|
||||
|
||||
@@ -25,6 +25,11 @@ import org.springframework.util.Assert;
|
||||
* a supported type-level annotation such as {@code @Component} (see
|
||||
* {@link AnnotationBeanNameGenerator} for details on supported annotations).
|
||||
*
|
||||
* <p>Favor this bean naming strategy over {@code 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).
|
||||
*
|
||||
* <p>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
|
||||
* {@code AnnotationBeanNameGenerator}.
|
||||
|
||||
Reference in New Issue
Block a user