Class XmlReaderContext
java.lang.Object
org.springframework.beans.factory.parsing.ReaderContext
org.springframework.beans.factory.xml.XmlReaderContext
Extension of 
ReaderContext,
 specific to use with an XmlBeanDefinitionReader. Provides access to the
 NamespaceHandlerResolver configured in the XmlBeanDefinitionReader.- Since:
- 2.0
- Author:
- Rob Harrop, Juergen Hoeller
- 
Constructor SummaryConstructorsConstructorDescriptionXmlReaderContext(Resource resource, ProblemReporter problemReporter, ReaderEventListener eventListener, SourceExtractor sourceExtractor, XmlBeanDefinitionReader reader, NamespaceHandlerResolver namespaceHandlerResolver) Construct a newXmlReaderContext.
- 
Method SummaryModifier and TypeMethodDescriptiongenerateBeanName(BeanDefinition beanDefinition) Call the bean name generator for the given bean definition.final ClassLoaderReturn the bean class loader to use, if any.final EnvironmentReturn the environment to use.final NamespaceHandlerResolverReturn the namespace resolver.final XmlBeanDefinitionReaderReturn the XML bean definition reader in use.final BeanDefinitionRegistryReturn the bean definition registry to use.final ResourceLoaderReturn the resource loader to use, if any.readDocumentFromString(String documentContent) Read an XML document from the given String.registerWithGeneratedName(BeanDefinition beanDefinition) Call the bean name generator for the given bean definition and register the bean definition under the generated name.Methods inherited from class org.springframework.beans.factory.parsing.ReaderContexterror, error, error, error, extractSource, fatal, fatal, fatal, fatal, fireAliasRegistered, fireComponentRegistered, fireDefaultsRegistered, fireImportProcessed, fireImportProcessed, getResource, getSourceExtractor, warning, warning, warning, warning
- 
Constructor Details- 
XmlReaderContextpublic XmlReaderContext(Resource resource, ProblemReporter problemReporter, ReaderEventListener eventListener, SourceExtractor sourceExtractor, XmlBeanDefinitionReader reader, NamespaceHandlerResolver namespaceHandlerResolver) Construct a newXmlReaderContext.- Parameters:
- resource- the XML bean definition resource
- problemReporter- the problem reporter in use
- eventListener- the event listener in use
- sourceExtractor- the source extractor in use
- reader- the XML bean definition reader in use
- namespaceHandlerResolver- the XML namespace resolver
 
 
- 
- 
Method Details- 
getReaderReturn the XML bean definition reader in use.
- 
getRegistryReturn the bean definition registry to use.
- 
getResourceLoaderReturn the resource loader to use, if any.This will be non-null in regular scenarios, also allowing access to the resource class loader. 
- 
getBeanClassLoaderReturn the bean class loader to use, if any.Note that this will be null in regular scenarios, as an indication to lazily resolve bean classes. 
- 
getEnvironmentReturn the environment to use.
- 
getNamespaceHandlerResolverReturn the namespace resolver.
- 
generateBeanNameCall the bean name generator for the given bean definition.
- 
registerWithGeneratedNameCall the bean name generator for the given bean definition and register the bean definition under the generated name.- See Also:
- 
- AbstractBeanDefinitionReader.getBeanNameGenerator()
- BeanNameGenerator.generateBeanName(org.springframework.beans.factory.config.BeanDefinition, org.springframework.beans.factory.support.BeanDefinitionRegistry)
- BeanDefinitionRegistry.registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition)
 
 
- 
readDocumentFromStringRead an XML document from the given String.- See Also:
 
 
-