org.springframework.beans.factory.xml

## 类 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, org.springframework.core.AliasRegistry

  已过时。
  as of Spring 3.1 in favor of `DefaultListableBeanFactory` and `XmlBeanDefinitionReader`

      @Deprecated
      public class XmlBeanFactory
      extends DefaultListableBeanFactory

  Convenience extension of `DefaultListableBeanFactory` that reads bean definitions from an XML document. Delegates to `XmlBeanDefinitionReader` 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 the `BeanFactory` 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 an `XmlBeanDefinitionReader`. 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.core.SimpleAliasRegistry

      `logger`

    - ### 从接口继承的字段 org.springframework.beans.factory.config.AutowireCapableBeanFactory

      `AUTOWIRE_AUTODETECT, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR, AUTOWIRE_NO`

    - ### 从接口继承的字段 org.springframework.beans.factory.config.ConfigurableBeanFactory

      `SCOPE_PROTOTYPE, SCOPE_SINGLETON`

    - ### 从接口继承的字段 org.springframework.beans.factory.BeanFactory

      `FACTORY_BEAN_PREFIX`

  - ### 构造器概要

    构造器
    构造器和说明
    `XmlBeanFactory(org.springframework.core.io.Resource resource)` 已过时。 Create a new XmlBeanFactory with the given resource, which must be parsable using DOM.
    `XmlBeanFactory(org.springframework.core.io.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, copyConfigurationFrom, destroySingleton, destroySingletons, determineAutowireCandidate, determineHighestPriorityCandidate, determinePrimaryCandidate, doResolveDependency, findAnnotationOnBean, findAutowireCandidates, freezeConfiguration, getAutowireCandidateResolver, getBean, getBean, getBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesIterator, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDependencyComparator, getPriority, getSerializationId, isAllowBeanDefinitionOverriding, isAllowEagerClassLoading, isAutowireCandidate, isAutowireCandidate, isAutowireCandidate, isBeanEligibleForMetadataCaching, isConfigurationFrozen, isPrimary, matchesBeanName, preInstantiateSingletons, registerBeanDefinition, registerResolvableDependency, registerSingleton, removeBeanDefinition, resetBeanDefinition, resolveDependency, resolveNamedBean, setAllowBeanDefinitionOverriding, setAllowEagerClassLoading, setAutowireCandidateResolver, setDependencyComparator, setSerializationId, toString, writeReplace`

    - ### 从类继承的方法 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory

      `applyBeanPostProcessorsAfterInitialization, applyBeanPostProcessorsBeforeInitialization, applyBeanPostProcessorsBeforeInstantiation, applyBeanPropertyValues, applyMergedBeanDefinitionPostProcessors, applyPropertyValues, autowire, autowireBean, autowireBeanProperties, autowireByName, autowireByType, autowireConstructor, checkDependencies, clearSingletonCache, configureBean, createBean, createBean, createBean, createBeanInstance, destroyBean, determineConstructorsFromBeanPostProcessors, determineTargetType, doCreateBean, filterPropertyDescriptorsForDependencyCheck, filterPropertyDescriptorsForDependencyCheck, getEarlyBeanReference, getInstantiationStrategy, getObjectForBeanInstance, getParameterNameDiscoverer, getTypeForFactoryBean, getTypeForFactoryMethod, ignoreDependencyInterface, ignoreDependencyType, initializeBean, initializeBean, instantiateBean, instantiateUsingFactoryMethod, invokeCustomInitMethod, invokeInitMethods, isExcludedFromDependencyCheck, obtainFromSupplier, populateBean, postProcessObjectFromFactoryBean, predictBeanType, removeSingleton, resolveBeforeInstantiation, resolveDependency, setAllowCircularReferences, setAllowRawInjectionDespiteWrapping, setInstantiationStrategy, setParameterNameDiscoverer, unsatisfiedNonSimpleProperties`

    - ### 从类继承的方法 org.springframework.beans.factory.support.AbstractBeanFactory

      `addBeanPostProcessor, addEmbeddedValueResolver, addPropertyEditorRegistrar, afterPrototypeCreation, beforePrototypeCreation, checkMergedBeanDefinition, cleanupAfterBeanCreationFailure, clearMergedBeanDefinition, containsBean, containsLocalBean, copyRegisteredEditorsTo, destroyBean, destroyBean, destroyScopedBean, doGetBean, evaluateBeanDefinitionString, getAccessControlContext, getAliases, getBean, getBean, getBean, getBean, getBeanClassLoader, getBeanExpressionResolver, getBeanPostProcessorCount, getBeanPostProcessors, getConversionService, getCustomEditors, getCustomTypeConverter, getMergedBeanDefinition, getMergedBeanDefinition, getMergedBeanDefinition, getMergedLocalBeanDefinition, getParentBeanFactory, getPropertyEditorRegistrars, getRegisteredScope, getRegisteredScopeNames, getTempClassLoader, getType, getTypeConverter, hasBeanCreationStarted, hasDestructionAwareBeanPostProcessors, hasEmbeddedValueResolver, hasInstantiationAwareBeanPostProcessors, initBeanWrapper, isActuallyInCreation, isBeanNameInUse, isCacheBeanMetadata, isFactoryBean, isFactoryBean, isPrototype, isPrototypeCurrentlyInCreation, isSingleton, isTypeMatch, isTypeMatch, markBeanAsCreated, originalBeanName, registerCustomEditor, registerCustomEditors, registerDisposableBeanIfNecessary, registerScope, removeSingletonIfCreatedForTypeCheckOnly, requiresDestruction, resolveBeanClass, resolveEmbeddedValue, setBeanClassLoader, setBeanExpressionResolver, setCacheBeanMetadata, setConversionService, setParentBeanFactory, setSecurityContextProvider, setTempClassLoader, setTypeConverter, transformedBeanName`

    - ### 从类继承的方法 org.springframework.beans.factory.support.FactoryBeanRegistrySupport

      `getCachedObjectForFactoryBean, getFactoryBean, getObjectFromFactoryBean, getTypeForFactoryBean`

    - ### 从类继承的方法 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry

      `addSingleton, addSingletonFactory, afterSingletonCreation, beforeSingletonCreation, containsSingleton, destroyBean, getDependenciesForBean, getDependentBeans, getSingleton, getSingleton, getSingleton, getSingletonCount, getSingletonMutex, getSingletonNames, hasDependentBean, isCurrentlyInCreation, isDependent, isSingletonCurrentlyInCreation, onSuppressedException, registerContainedBean, registerDependentBean, registerDisposableBean, setCurrentlyInCreation`

    - ### 从类继承的方法 org.springframework.core.SimpleAliasRegistry

      `canonicalName, checkForAliasCircle, hasAlias, isAlias, registerAlias, removeAlias, resolveAliases`

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### 从接口继承的方法 org.springframework.beans.factory.config.ConfigurableListableBeanFactory

      `ignoreDependencyInterface, ignoreDependencyType`

    - ### 从接口继承的方法 org.springframework.beans.factory.config.AutowireCapableBeanFactory

      `applyBeanPostProcessorsAfterInitialization, applyBeanPostProcessorsBeforeInitialization, applyBeanPropertyValues, autowire, autowireBean, autowireBeanProperties, configureBean, createBean, createBean, destroyBean, initializeBean, resolveDependency`

    - ### 从接口继承的方法 org.springframework.beans.factory.config.ConfigurableBeanFactory

      `addBeanPostProcessor, addEmbeddedValueResolver, addPropertyEditorRegistrar, copyRegisteredEditorsTo, destroyBean, destroyScopedBean, getAccessControlContext, getBeanClassLoader, getBeanExpressionResolver, getBeanPostProcessorCount, getConversionService, getDependenciesForBean, getDependentBeans, getMergedBeanDefinition, getRegisteredScope, getRegisteredScopeNames, getTempClassLoader, getTypeConverter, hasEmbeddedValueResolver, isCacheBeanMetadata, isCurrentlyInCreation, isFactoryBean, registerAlias, registerCustomEditor, registerDependentBean, registerScope, resolveAliases, resolveEmbeddedValue, setBeanClassLoader, setBeanExpressionResolver, setCacheBeanMetadata, setConversionService, setCurrentlyInCreation, setParentBeanFactory, setTempClassLoader, setTypeConverter`

    - ### 从接口继承的方法 org.springframework.beans.factory.HierarchicalBeanFactory

      `containsLocalBean, getParentBeanFactory`

    - ### 从接口继承的方法 org.springframework.beans.factory.BeanFactory

      `containsBean, getAliases, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch, isTypeMatch`

    - ### 从接口继承的方法 org.springframework.beans.factory.config.SingletonBeanRegistry

      `containsSingleton, getSingleton, getSingletonCount, getSingletonMutex, getSingletonNames`

    - ### 从接口继承的方法 org.springframework.beans.factory.support.BeanDefinitionRegistry

      `isBeanNameInUse`

    - ### 从接口继承的方法 org.springframework.core.AliasRegistry

      `getAliases, isAlias, registerAlias, removeAlias`

- - ### 构造器详细资料

    - #### XmlBeanFactory

          public XmlBeanFactory(org.springframework.core.io.Resource resource)
                         throws BeansException

      已过时。
      Create a new XmlBeanFactory with the given resource, which must be parsable using DOM.
      参数:
        `resource` - XML resource to load bean definitions from
      抛出:
        `BeansException` - in case of loading or parsing errors

    - #### XmlBeanFactory

          public XmlBeanFactory(org.springframework.core.io.Resource resource,
                                BeanFactory parentBeanFactory)
                         throws BeansException

      已过时。
      Create a new XmlBeanFactory with the given input stream, which must be parsable using DOM.
      参数:
        `resource` - XML resource to load bean definitions from
        `parentBeanFactory` - parent bean factory
      抛出:
        `BeansException` - in case of loading or parsing errors