DefaultListableBeanFactory
and
XmlBeanDefinitionReader
@Deprecated public class XmlBeanFactory extends DefaultListableBeanFactory
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.
DefaultListableBeanFactory
,
XmlBeanDefinitionReader
,
Serialized Formlogger
AUTOWIRE_AUTODETECT, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR, AUTOWIRE_NO, ORIGINAL_INSTANCE_SUFFIX
SCOPE_PROTOTYPE, SCOPE_SINGLETON
FACTORY_BEAN_PREFIX
Constructor and Description |
---|
XmlBeanFactory(Resource resource)
Deprecated.
Create a new XmlBeanFactory with the given resource,
which must be parsable using DOM.
|
XmlBeanFactory(Resource resource,
BeanFactory parentBeanFactory)
Deprecated.
Create a new XmlBeanFactory with the given input stream,
which must be parsable using DOM.
|
allowAliasOverriding, checkForAliasCircle, clearMergedBeanDefinition, clearMetadataCache, containsBeanDefinition, copyConfigurationFrom, destroySingleton, destroySingletons, determineAutowireCandidate, determineHighestPriorityCandidate, determinePrimaryCandidate, doResolveDependency, findAnnotationOnBean, findAutowireCandidates, freezeConfiguration, getAutowireCandidateResolver, getBean, getBean, getBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesIterator, getBeanProvider, getBeanProvider, getBeanProvider, getBeanProvider, 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
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, getTypeForFactoryBean, getTypeForFactoryMethod, ignoreDependencyInterface, ignoreDependencyType, initializeBean, initializeBean, instantiateBean, instantiateUsingFactoryMethod, invokeCustomInitMethod, invokeInitMethods, isAllowCircularReferences, isAllowRawInjectionDespiteWrapping, isExcludedFromDependencyCheck, obtainFromSupplier, populateBean, postProcessObjectFromFactoryBean, predictBeanType, removeSingleton, resolveBeanByName, resolveBeforeInstantiation, resolveDependency, setAllowCircularReferences, setAllowRawInjectionDespiteWrapping, setInstantiationStrategy, setParameterNameDiscoverer, unsatisfiedNonSimpleProperties
addBeanPostProcessor, addBeanPostProcessors, addEmbeddedValueResolver, addPropertyEditorRegistrar, afterPrototypeCreation, beforePrototypeCreation, checkMergedBeanDefinition, cleanupAfterBeanCreationFailure, containsBean, containsLocalBean, copyRegisteredEditorsTo, destroyBean, destroyBean, destroyScopedBean, doGetBean, evaluateBeanDefinitionString, getAccessControlContext, getAliases, getApplicationStartup, getBean, getBean, getBean, getBean, getBeanClassLoader, getBeanExpressionResolver, getBeanPostProcessorCount, getBeanPostProcessors, getConversionService, getCustomEditors, getCustomTypeConverter, getMergedBeanDefinition, getMergedBeanDefinition, getMergedBeanDefinition, getMergedLocalBeanDefinition, getParentBeanFactory, getPropertyEditorRegistrars, getRegisteredScope, getRegisteredScopeNames, getTempClassLoader, getType, getType, getTypeConverter, hasBeanCreationStarted, hasDestructionAwareBeanPostProcessors, hasEmbeddedValueResolver, hasInstantiationAwareBeanPostProcessors, initBeanWrapper, isActuallyInCreation, isBeanNameInUse, isCacheBeanMetadata, isFactoryBean, isFactoryBean, isPrototype, isPrototypeCurrentlyInCreation, isSingleton, isTypeMatch, isTypeMatch, isTypeMatch, markBeanAsCreated, originalBeanName, registerCustomEditor, registerCustomEditors, registerDisposableBeanIfNecessary, registerScope, removeSingletonIfCreatedForTypeCheckOnly, requiresDestruction, resolveBeanClass, resolveEmbeddedValue, setApplicationStartup, setBeanClassLoader, setBeanExpressionResolver, setCacheBeanMetadata, setConversionService, setParentBeanFactory, setSecurityContextProvider, setTempClassLoader, setTypeConverter, transformedBeanName
getCachedObjectForFactoryBean, getFactoryBean, getObjectFromFactoryBean, getTypeForFactoryBean
addSingleton, addSingletonFactory, afterSingletonCreation, beforeSingletonCreation, containsSingleton, destroyBean, getDependenciesForBean, getDependentBeans, getSingleton, getSingleton, getSingleton, getSingletonCount, getSingletonMutex, getSingletonNames, hasDependentBean, isCurrentlyInCreation, isDependent, isSingletonCurrentlyInCreation, onSuppressedException, registerContainedBean, registerDependentBean, registerDisposableBean, setCurrentlyInCreation
canonicalName, hasAlias, isAlias, registerAlias, removeAlias, resolveAliases
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
ignoreDependencyInterface, ignoreDependencyType
applyBeanPostProcessorsAfterInitialization, applyBeanPostProcessorsBeforeInitialization, applyBeanPropertyValues, autowire, autowireBean, autowireBeanProperties, configureBean, createBean, createBean, destroyBean, initializeBean, resolveBeanByName, resolveDependency
addBeanPostProcessor, addEmbeddedValueResolver, addPropertyEditorRegistrar, copyRegisteredEditorsTo, destroyBean, destroyScopedBean, getAccessControlContext, getApplicationStartup, getBeanClassLoader, getBeanExpressionResolver, getBeanPostProcessorCount, getConversionService, getDependenciesForBean, getDependentBeans, getMergedBeanDefinition, getRegisteredScope, getRegisteredScopeNames, getTempClassLoader, getTypeConverter, hasEmbeddedValueResolver, isCacheBeanMetadata, isCurrentlyInCreation, isFactoryBean, registerAlias, registerCustomEditor, registerDependentBean, registerScope, resolveAliases, resolveEmbeddedValue, setApplicationStartup, setBeanClassLoader, setBeanExpressionResolver, setCacheBeanMetadata, setConversionService, setCurrentlyInCreation, setParentBeanFactory, setTempClassLoader, setTypeConverter
containsLocalBean, getParentBeanFactory
containsBean, getAliases, getBean, getBean, getBean, getType, getType, isPrototype, isSingleton, isTypeMatch, isTypeMatch
containsSingleton, getSingleton, getSingletonCount, getSingletonMutex, getSingletonNames
isBeanNameInUse
getAliases, isAlias, registerAlias, removeAlias
public XmlBeanFactory(Resource resource) throws BeansException
resource
- the XML resource to load bean definitions fromBeansException
- in case of loading or parsing errorspublic XmlBeanFactory(Resource resource, BeanFactory parentBeanFactory) throws BeansException
resource
- the XML resource to load bean definitions fromparentBeanFactory
- parent bean factoryBeansException
- in case of loading or parsing errors