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 Summary
ConstructorDescriptionXmlReaderContext
(Resource resource, ProblemReporter problemReporter, ReaderEventListener eventListener, SourceExtractor sourceExtractor, XmlBeanDefinitionReader reader, NamespaceHandlerResolver namespaceHandlerResolver) Construct a newXmlReaderContext
. -
Method Summary
Modifier and TypeMethodDescriptiongenerateBeanName
(BeanDefinition beanDefinition) Call the bean name generator for the given bean definition.final ClassLoader
Return the bean class loader to use, if any.final Environment
Return the environment to use.final NamespaceHandlerResolver
Return the namespace resolver.final XmlBeanDefinitionReader
Return the XML bean definition reader in use.final BeanDefinitionRegistry
Return the bean definition registry to use.final ResourceLoader
Return 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.ReaderContext
error, error, error, error, extractSource, fatal, fatal, fatal, fatal, fireAliasRegistered, fireComponentRegistered, fireDefaultsRegistered, fireImportProcessed, fireImportProcessed, getResource, getSourceExtractor, warning, warning, warning, warning
-
Constructor Details
-
XmlReaderContext
public XmlReaderContext(Resource resource, ProblemReporter problemReporter, ReaderEventListener eventListener, SourceExtractor sourceExtractor, XmlBeanDefinitionReader reader, NamespaceHandlerResolver namespaceHandlerResolver) Construct a newXmlReaderContext
.- Parameters:
resource
- the XML bean definition resourceproblemReporter
- the problem reporter in useeventListener
- the event listener in usesourceExtractor
- the source extractor in usereader
- the XML bean definition reader in usenamespaceHandlerResolver
- the XML namespace resolver
-
-
Method Details
-
getReader
Return the XML bean definition reader in use. -
getRegistry
Return the bean definition registry to use. -
getResourceLoader
Return the resource loader to use, if any.This will be non-null in regular scenarios, also allowing access to the resource class loader.
-
getBeanClassLoader
Return 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.
-
getEnvironment
Return the environment to use. -
getNamespaceHandlerResolver
Return the namespace resolver. -
generateBeanName
Call the bean name generator for the given bean definition. -
registerWithGeneratedName
Call 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)
-
readDocumentFromString
Read an XML document from the given String.- See Also:
-