BeanFactory is asked for a bean instance for which
multiple matching candidates have been found when only one matching bean was expected.
BeanFactory#getBean(Class)
| Modifier and Type | Field and Description |
|---|---|
| private final Collection | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | NoUniqueBeanDefinitionException(Class<?>
required type of the non-unique bean type, int the number of matching beans numberOfBeansFound, String detailed message describing the problem message)Create a new |
| public | NoUniqueBeanDefinitionException(Class<?>
required type of the non-unique bean type, Collection<String> the names of all matching beans (as a Collection) beanNamesFound)Create a new |
| public | NoUniqueBeanDefinitionException(Class<?>
required type of the non-unique bean type, String... the names of all matching beans (as an array) beanNamesFound)Create a new |
| public | NoUniqueBeanDefinitionException(ResolvableType
required type of the non-unique bean type, Collection<String> the names of all matching beans (as a Collection) beanNamesFound)Create a new |
| public | NoUniqueBeanDefinitionException(ResolvableType
required type of the non-unique bean type, String... the names of all matching beans (as an array) beanNamesFound)Create a new |
| Modifier and Type | Method and Description |
|---|---|
| public Collection | |
| public int | getNumberOfBeansFound()
Overrides org. Return the number of beans found when only one matching bean was expected. |
| beanNamesFound | back to summary |
|---|---|
| private final Collection<String> beanNamesFound
| |
| numberOfBeansFound | back to summary |
|---|---|
| private final int numberOfBeansFound | |
| NoUniqueBeanDefinitionException | back to summary |
|---|---|
| public NoUniqueBeanDefinitionException(Class<?> type, int numberOfBeansFound, String message) Create a new | |
| NoUniqueBeanDefinitionException | back to summary |
|---|---|
| public NoUniqueBeanDefinitionException(Class<?> type, Collection<String> beanNamesFound) Create a new
| |
| NoUniqueBeanDefinitionException | back to summary |
|---|---|
| public NoUniqueBeanDefinitionException(Class<?> type, String... beanNamesFound) Create a new | |
| NoUniqueBeanDefinitionException | back to summary |
|---|---|
| public NoUniqueBeanDefinitionException(ResolvableType type, Collection<String> beanNamesFound) Create a new
| |
| NoUniqueBeanDefinitionException | back to summary |
|---|---|
| public NoUniqueBeanDefinitionException(ResolvableType type, String... beanNamesFound) Create a new
| |
| getBeanNamesFound | back to summary |
|---|---|
| public Collection Return the names of all beans found when only one matching bean was expected.
Note that this may be
| |
| getNumberOfBeansFound | back to summary |
|---|---|
| public int getNumberOfBeansFound() Overrides org. Return the number of beans found when only one matching bean was expected. For a NoUniqueBeanDefinitionException, this will usually be higher than 1.
| |