|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.beans.factory.support.AbstractBeanDefinitionReader org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Bean definition reader for XML bean definitions. Delegates the actual XML parsing to an implementation of the XmlBeanDefinitionParser interface. Typically applied to a DefaultListableBeanFactory.
This class loads a DOM document and applies the bean definition parser to it. The parser will register each bean definition with the given bean factory, relying on the latter's implementation of the BeanDefinitionRegistry interface.
setParserClass(java.lang.Class)
,
XmlBeanDefinitionParser
,
DefaultXmlBeanDefinitionParser
,
BeanDefinitionRegistry
,
DefaultListableBeanFactory
Field Summary |
Fields inherited from class org.springframework.beans.factory.support.AbstractBeanDefinitionReader |
logger |
Constructor Summary | |
XmlBeanDefinitionReader(BeanDefinitionRegistry beanFactory)
Create new XmlBeanDefinitionReader for the given bean factory. |
Method Summary | |
int |
loadBeanDefinitions(Resource resource)
Load bean definitions from the specified XML file. |
int |
registerBeanDefinitions(Document doc,
Resource resource)
Register the bean definitions contained in the given DOM document. |
void |
setEntityResolver(EntityResolver entityResolver)
Set a SAX entity resolver to be used for parsing. |
void |
setParserClass(Class parserClass)
Set the XmlBeanDefinitionParser implementation to use, responsible for the actual parsing of XML bean definitions. |
void |
setValidating(boolean validating)
Set if the XML parser should validate the document and thus enforce a DTD. |
Methods inherited from class org.springframework.beans.factory.support.AbstractBeanDefinitionReader |
getBeanClassLoader, getBeanFactory, setBeanClassLoader |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XmlBeanDefinitionReader(BeanDefinitionRegistry beanFactory)
Method Detail |
public void setValidating(boolean validating)
public void setEntityResolver(EntityResolver entityResolver)
BeansDtdResolver
public void setParserClass(Class parserClass)
XmlBeanDefinitionParser
,
DefaultXmlBeanDefinitionParser
public int loadBeanDefinitions(Resource resource) throws BeansException
resource
- the resource descriptor for the XML file
BeansException
- in case of loading or parsing errorspublic int registerBeanDefinitions(Document doc, Resource resource) throws BeansException
loadBeanDefinitions
.
Creates a new instance of the parser class and invokes
registerBeanDefinitions
on it.
doc
- the DOM documentresource
- the resource descriptor (for context information)
BeansException
- in case of parsing errorsloadBeanDefinitions(org.springframework.core.io.Resource)
,
setParserClass(java.lang.Class)
,
XmlBeanDefinitionParser.registerBeanDefinitions(org.springframework.beans.factory.support.BeanDefinitionReader, org.w3c.dom.Document, org.springframework.core.io.Resource)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |