spring-framework / org.springframework.beans.factory.xml / BeanDefinitionDocumentReader

BeanDefinitionDocumentReader

interface BeanDefinitionDocumentReader

SPI for parsing an XML document that contains Spring bean definitions. Used by XmlBeanDefinitionReader for actually parsing a DOM document.

Instantiated per document to parse: implementations can hold state in instance variables during the execution of the registerBeanDefinitions method — for example, global settings that are defined for all bean definitions in the document.

Author
Juergen Hoeller

Author
Rob Harrop

Since
18.12.2003

See Also
XmlBeanDefinitionReader#setDocumentReaderClass

Functions

registerBeanDefinitions

abstract fun registerBeanDefinitions(doc: Document, readerContext: XmlReaderContext): Unit

Read bean definitions from the given DOM document and register them with the registry in the given reader context.

Inheritors

DefaultBeanDefinitionDocumentReader

open class DefaultBeanDefinitionDocumentReader : BeanDefinitionDocumentReader

Default implementation of the BeanDefinitionDocumentReader interface that reads bean definitions according to the "spring-beans" DTD and XSD format (Spring's default XML bean definition format).

The structure, elements, 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> does not need to be the root element of the XML document: this class will parse all bean definition elements in the XML file, regardless of the actual root element.