public class BeanDefinitionOverrideException extends BeanDefinitionStoreException
BeanDefinitionStoreException
indicating an invalid override
attempt: typically registering a new definition for the same bean name while
DefaultListableBeanFactory.isAllowBeanDefinitionOverriding()
is false
.Modifier and Type | Field and Description |
---|---|
private BeanDefinition |
beanDefinition |
private BeanDefinition |
existingDefinition |
Constructor and Description |
---|
BeanDefinitionOverrideException(java.lang.String beanName,
BeanDefinition beanDefinition,
BeanDefinition existingDefinition)
Create a new BeanDefinitionOverrideException for the given new and existing definition.
|
Modifier and Type | Method and Description |
---|---|
BeanDefinition |
getBeanDefinition()
Return the newly registered bean definition.
|
java.lang.String |
getBeanName()
Return the name of the bean.
|
BeanDefinition |
getExistingDefinition()
Return the existing bean definition for the same name.
|
java.lang.String |
getResourceDescription()
Return the description of the resource that the bean definition came from.
|
contains, getMessage, getMostSpecificCause, getRootCause
private final BeanDefinition beanDefinition
private final BeanDefinition existingDefinition
public BeanDefinitionOverrideException(java.lang.String beanName, BeanDefinition beanDefinition, BeanDefinition existingDefinition)
beanName
- the name of the beanbeanDefinition
- the newly registered bean definitionexistingDefinition
- the existing bean definition for the same name@NonNull public java.lang.String getResourceDescription()
getResourceDescription
in class BeanDefinitionStoreException
@NonNull public java.lang.String getBeanName()
getBeanName
in class BeanDefinitionStoreException
public BeanDefinition getBeanDefinition()
getBeanName()
public BeanDefinition getExistingDefinition()
getBeanName()