类 SimpleBeanDefinitionRegistry
- java.lang.Object
- org.springframework.core.SimpleAliasRegistry
- org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry
- 所有已实现的接口:
BeanDefinitionRegistry
,AliasRegistry
public class SimpleBeanDefinitionRegistry extends SimpleAliasRegistry implements BeanDefinitionRegistry
Simple implementation of theBeanDefinitionRegistry
interface. Provides registry capabilities only, with no factory capabilities built in. Can for example be used for testing bean definition readers.- 从以下版本开始:
- 2.5.2
- 作者:
- Juergen Hoeller
构造器概要
构造器 构造器 说明 SimpleBeanDefinitionRegistry()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
containsBeanDefinition(String beanName)
Check if this registry contains a bean definition with the given name.BeanDefinition
getBeanDefinition(String beanName)
Return the BeanDefinition for the given bean name.int
getBeanDefinitionCount()
Return the number of beans defined in the registry.String[]
getBeanDefinitionNames()
Return the names of all beans defined in this registry.boolean
isBeanNameInUse(String beanName)
Determine whether the given bean name is already in use within this registry, i.e. whether there is a local bean or alias registered under this name.void
registerBeanDefinition(String beanName, BeanDefinition beanDefinition)
Register a new bean definition with this registry.void
removeBeanDefinition(String beanName)
Remove the BeanDefinition for the given name.从类继承的方法 org.springframework.core.SimpleAliasRegistry
allowAliasOverriding, canonicalName, checkForAliasCircle, getAliases, hasAlias, isAlias, registerAlias, removeAlias, resolveAliases
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.core.AliasRegistry
getAliases, isAlias, registerAlias, removeAlias
构造器详细资料
SimpleBeanDefinitionRegistry
public SimpleBeanDefinitionRegistry()
方法详细资料
registerBeanDefinition
public void registerBeanDefinition(String beanName, BeanDefinition beanDefinition) throws BeanDefinitionStoreException
从接口复制的说明:BeanDefinitionRegistry
Register a new bean definition with this registry. Must support RootBeanDefinition and ChildBeanDefinition.- 指定者:
registerBeanDefinition
在接口中BeanDefinitionRegistry
- 参数:
beanName
- the name of the bean instance to registerbeanDefinition
- definition of the bean instance to register- 抛出:
BeanDefinitionStoreException
- if the BeanDefinition is invalid or if there is already a BeanDefinition for the specified bean name (and we are not allowed to override it)- 另请参阅:
GenericBeanDefinition
,RootBeanDefinition
,ChildBeanDefinition
removeBeanDefinition
public void removeBeanDefinition(String beanName) throws NoSuchBeanDefinitionException
从接口复制的说明:BeanDefinitionRegistry
Remove the BeanDefinition for the given name.- 指定者:
removeBeanDefinition
在接口中BeanDefinitionRegistry
- 参数:
beanName
- the name of the bean instance to register- 抛出:
NoSuchBeanDefinitionException
- if there is no such bean definition
getBeanDefinition
public BeanDefinition getBeanDefinition(String beanName) throws NoSuchBeanDefinitionException
从接口复制的说明:BeanDefinitionRegistry
Return the BeanDefinition for the given bean name.- 指定者:
getBeanDefinition
在接口中BeanDefinitionRegistry
- 参数:
beanName
- name of the bean to find a definition for- 返回:
- the BeanDefinition for the given name (never
null
) - 抛出:
NoSuchBeanDefinitionException
- if there is no such bean definition
containsBeanDefinition
public boolean containsBeanDefinition(String beanName)
从接口复制的说明:BeanDefinitionRegistry
Check if this registry contains a bean definition with the given name.- 指定者:
containsBeanDefinition
在接口中BeanDefinitionRegistry
- 参数:
beanName
- the name of the bean to look for- 返回:
- if this registry contains a bean definition with the given name
getBeanDefinitionNames
public String[] getBeanDefinitionNames()
从接口复制的说明:BeanDefinitionRegistry
Return the names of all beans defined in this registry.- 指定者:
getBeanDefinitionNames
在接口中BeanDefinitionRegistry
- 返回:
- the names of all beans defined in this registry, or an empty array if none defined
getBeanDefinitionCount
public int getBeanDefinitionCount()
从接口复制的说明:BeanDefinitionRegistry
Return the number of beans defined in the registry.- 指定者:
getBeanDefinitionCount
在接口中BeanDefinitionRegistry
- 返回:
- the number of beans defined in the registry
isBeanNameInUse
public boolean isBeanNameInUse(String beanName)
从接口复制的说明:BeanDefinitionRegistry
Determine whether the given bean name is already in use within this registry, i.e. whether there is a local bean or alias registered under this name.- 指定者:
isBeanNameInUse
在接口中BeanDefinitionRegistry
- 参数:
beanName
- the name to check- 返回:
- whether the given bean name is already in use