类 XmlBeanFactory
- java.lang.Object
- org.springframework.core.SimpleAliasRegistry
- org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
- org.springframework.beans.factory.support.FactoryBeanRegistrySupport
- org.springframework.beans.factory.support.AbstractBeanFactory
- org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
- org.springframework.beans.factory.support.DefaultListableBeanFactory
- org.springframework.beans.factory.xml.XmlBeanFactory
- 所有已实现的接口:
Serializable
,BeanFactory
,AutowireCapableBeanFactory
,ConfigurableBeanFactory
,ConfigurableListableBeanFactory
,SingletonBeanRegistry
,HierarchicalBeanFactory
,ListableBeanFactory
,BeanDefinitionRegistry
,AliasRegistry
@Deprecated public class XmlBeanFactory extends DefaultListableBeanFactory
已过时。as of Spring 3.1 in favor ofDefaultListableBeanFactory
andXmlBeanDefinitionReader
Convenience extension ofDefaultListableBeanFactory
that reads bean definitions from an XML document. Delegates toXmlBeanDefinitionReader
underneath; effectively equivalent to using an XmlBeanDefinitionReader with a DefaultListableBeanFactory.The structure, element and attribute names of the required XML document are hard-coded in this class. (Of course a transform could be run if necessary to produce this format). "beans" doesn't need to be the root element of the XML document: This class will parse all bean definition elements in the XML file.
This class registers each bean definition with the
DefaultListableBeanFactory
superclass, and relies on the latter's implementation of theBeanFactory
interface. It supports singletons, prototypes, and references to either of these kinds of bean. See"spring-beans-3.x.xsd"
(or historically,"spring-beans-2.0.dtd"
) for details on options and configuration style.For advanced needs, consider using a
DefaultListableBeanFactory
with anXmlBeanDefinitionReader
. The latter allows for reading from multiple XML resources and is highly configurable in its actual XML parsing behavior.- 从以下版本开始:
- 15 April 2001
- 作者:
- Rod Johnson, Juergen Hoeller, Chris Beams
- 另请参阅:
DefaultListableBeanFactory
,XmlBeanDefinitionReader
, 序列化表格
字段概要
从类继承的字段 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
logger, NULL_OBJECT
从接口继承的字段 org.springframework.beans.factory.config.AutowireCapableBeanFactory
AUTOWIRE_AUTODETECT, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR, AUTOWIRE_NO
从接口继承的字段 org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
从接口继承的字段 org.springframework.beans.factory.config.ConfigurableBeanFactory
SCOPE_PROTOTYPE, SCOPE_SINGLETON
构造器概要
构造器 构造器 说明 XmlBeanFactory(Resource resource)
已过时。Create a new XmlBeanFactory with the given resource, which must be parsable using DOM.XmlBeanFactory(Resource resource, BeanFactory parentBeanFactory)
已过时。Create a new XmlBeanFactory with the given input stream, which must be parsable using DOM.
方法概要
从类继承的方法 org.springframework.beans.factory.support.DefaultListableBeanFactory
allowAliasOverriding, clearMetadataCache, containsBeanDefinition,