|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.beans.factory.support.AbstractBeanDefinitionReader
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
Bean definition reader for Spring's default XML bean definition format. Typically applied to 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 given bean factory superclass, and relies on the latter's implementation of the BeanDefinitionRegistry interface. It supports singletons, prototypes, and references to either of these kinds of bean.
setParserClass(java.lang.Class)
Field Summary | |
protected org.apache.commons.logging.Log |
logger
|
Constructor Summary | |
XmlBeanDefinitionReader(BeanDefinitionRegistry beanFactory)
Create new XmlBeanDefinitionReader for the given bean factory. |
Method Summary | |
void |
loadBeanDefinitions(Resource resource)
Load bean definitions from the specified XML file. |
void |
registerBeanDefinitions(org.w3c.dom.Document doc,
Resource resource)
Register the bean definitions contained in the given DOM document. |
void |
setEntityResolver(org.xml.sax.EntityResolver entityResolver)
Set a SAX entity resolver to be used for parsing. |
void |
setParserClass(java.lang.Class parserClass)
Set the XmlBeanDefinitionParser implementation to use. |
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 |
Field Detail |
protected final org.apache.commons.logging.Log logger
Constructor Detail |
public XmlBeanDefinitionReader(BeanDefinitionRegistry beanFactory)
Method Detail |
public void setValidating(boolean validating)
public void setEntityResolver(org.xml.sax.EntityResolver entityResolver)
BeansDtdResolver
public void setParserClass(java.lang.Class parserClass)
XmlBeanDefinitionParser
,
DefaultXmlBeanDefinitionParser
public void loadBeanDefinitions(Resource resource) throws BeansException
resource
- the resource descriptor for the XML file
BeansException
- in case of loading or parsing errorspublic void registerBeanDefinitions(org.w3c.dom.Document doc, Resource resource) throws BeansException
doc
- the DOM document
BeansException
- in case of parsing errors
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |