public class XmlReaderContext extends ReaderContext
ReaderContext
,
specific to use with an XmlBeanDefinitionReader
. Provides access to the
NamespaceHandlerResolver
configured in the XmlBeanDefinitionReader
.Constructor and Description |
---|
XmlReaderContext(Resource resource,
ProblemReporter problemReporter,
ReaderEventListener eventListener,
SourceExtractor sourceExtractor,
XmlBeanDefinitionReader reader,
NamespaceHandlerResolver namespaceHandlerResolver)
Construct a new
XmlReaderContext . |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
generateBeanName(BeanDefinition beanDefinition)
Call the bean name generator for the given bean definition.
|
java.lang.ClassLoader |
getBeanClassLoader()
Return the bean class loader to use, if any.
|
Environment |
getEnvironment()
Return the environment to use.
|
NamespaceHandlerResolver |
getNamespaceHandlerResolver()
Return the namespace resolver.
|
XmlBeanDefinitionReader |
getReader()
Return the XML bean definition reader in use.
|
BeanDefinitionRegistry |
getRegistry()
Return the bean definition registry to use.
|
ResourceLoader |
getResourceLoader()
Return the resource loader to use, if any.
|
org.w3c.dom.Document |
readDocumentFromString(java.lang.String documentContent)
Read an XML document from the given String.
|
java.lang.String |
registerWithGeneratedName(BeanDefinition beanDefinition)
Call the bean name generator for the given bean definition
and register the bean definition under the generated name.
|
error, error, error, error, extractSource, fatal, fatal, fatal, fatal, fireAliasRegistered, fireComponentRegistered, fireDefaultsRegistered, fireImportProcessed, fireImportProcessed, getResource, getSourceExtractor, warning, warning, warning, warning
public XmlReaderContext(Resource resource, ProblemReporter problemReporter, ReaderEventListener eventListener, SourceExtractor sourceExtractor, XmlBeanDefinitionReader reader, NamespaceHandlerResolver namespaceHandlerResolver)
XmlReaderContext
.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 resolverpublic final XmlBeanDefinitionReader getReader()
public final BeanDefinitionRegistry getRegistry()
@Nullable public final ResourceLoader getResourceLoader()
This will be non-null in regular scenarios, also allowing access to the resource class loader.
@Nullable public final java.lang.ClassLoader getBeanClassLoader()
Note that this will be null in regular scenarios, as an indication to lazily resolve bean classes.
public final Environment getEnvironment()
public final NamespaceHandlerResolver getNamespaceHandlerResolver()
public java.lang.String generateBeanName(BeanDefinition beanDefinition)
public java.lang.String registerWithGeneratedName(BeanDefinition beanDefinition)
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)
public org.w3c.dom.Document readDocumentFromString(java.lang.String documentContent)
getReader()