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.
| Modifier and Type | Field and Description |
|---|---|
| public static final String | |
| public static final String | |
| public static final String | |
| private BeanDefinitionParserDelegate | |
| public static final String | |
| protected final Log | |
| public static final String | |
| public static final String | |
| public static final String | |
| private XmlReaderContext | |
| public static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected BeanDefinitionParserDelegate | createDelegate(XmlReaderContext readerContext, Element root, BeanDefinitionParserDelegate parentDelegate)
|
| protected void | doRegisterBeanDefinitions(Element root)
Register each bean definition within the given root |
| protected Object | extractSource(Element ele)
Invoke the |
| protected final XmlReaderContext | |
| protected void | importBeanDefinitionResource(Element ele)
Parse an "import" element and load the bean definitions from the given resource into the bean factory. |
| protected void | parseBeanDefinitions(Element
the DOM root element of the document root, BeanDefinitionParserDelegate delegate)Parse the elements at the root level in the document: "import", "alias", "bean". |
| private void | |
| protected void | postProcessXml(Element root)
Allow the XML to be extensible by processing any custom element types last, after we finished processing the bean definitions. |
| protected void | preProcessXml(Element root)
Allow the XML to be extensible by processing any custom element types first, before we start to process the bean definitions. |
| protected void | processAliasRegistration(Element ele)
Process the given alias element, registering the alias with the registry. |
| protected void | processBeanDefinition(Element ele, BeanDefinitionParserDelegate delegate)
Process the given bean element, parsing the bean definition and registering it with the registry. |
| public void | registerBeanDefinitions(Document
the DOM document doc, XmlReaderContext the current context of the reader
(includes the target registry and the resource being parsed) readerContext)Implements org. This implementation parses bean definitions according to the "spring-beans" XSD (or DTD, historically). |
| ALIAS_ATTRIBUTE | back to summary |
|---|---|
| public static final String ALIAS_ATTRIBUTE | |
| ALIAS_ELEMENT | back to summary |
|---|---|
| public static final String ALIAS_ELEMENT | |
| BEAN_ELEMENT | back to summary |
|---|---|
| public static final String BEAN_ELEMENT | |
| delegate | back to summary |
|---|---|
| private BeanDefinitionParserDelegate delegate
| |
| IMPORT_ELEMENT | back to summary |
|---|---|
| public static final String IMPORT_ELEMENT | |
| logger | back to summary |
|---|---|
| protected final Log logger | |
| NAME_ATTRIBUTE | back to summary |
|---|---|
| public static final String NAME_ATTRIBUTE | |
| NESTED_BEANS_ELEMENT | back to summary |
|---|---|
| public static final String NESTED_BEANS_ELEMENT | |
| PROFILE_ATTRIBUTE | back to summary |
|---|---|
| public static final String PROFILE_ATTRIBUTE | |
| readerContext | back to summary |
|---|---|
| private XmlReaderContext readerContext
| |
| RESOURCE_ATTRIBUTE | back to summary |
|---|---|
| public static final String RESOURCE_ATTRIBUTE | |
| DefaultBeanDefinitionDocumentReader | back to summary |
|---|---|
| public DefaultBeanDefinitionDocumentReader() | |
| createDelegate | back to summary |
|---|---|
| protected BeanDefinitionParserDelegate createDelegate(XmlReaderContext readerContext, Element root, BeanDefinitionParserDelegate parentDelegate) | |
| doRegisterBeanDefinitions | back to summary |
|---|---|
| protected void doRegisterBeanDefinitions(Element root) Register each bean definition within the given root
| |
| extractSource | back to summary |
|---|---|
| protected Object extractSource(Element ele) Invoke the
| |
| getReaderContext | back to summary |
|---|---|
| protected final XmlReaderContext getReaderContext() Return the descriptor for the XML resource that this parser works on. | |
| importBeanDefinitionResource | back to summary |
|---|---|
| protected void importBeanDefinitionResource(Element ele) Parse an "import" element and load the bean definitions from the given resource into the bean factory. | |
| parseBeanDefinitions | back to summary |
|---|---|
| protected void parseBeanDefinitions(Element root, BeanDefinitionParserDelegate delegate) Parse the elements at the root level in the document: "import", "alias", "bean".
| |
| parseDefaultElement | back to summary |
|---|---|
| private void parseDefaultElement(Element ele, BeanDefinitionParserDelegate delegate) | |
| postProcessXml | back to summary |
|---|---|
| protected void postProcessXml(Element root) Allow the XML to be extensible by processing any custom element types last, after we finished processing the bean definitions. This method is a natural extension point for any other custom post-processing of the XML. The default implementation is empty. Subclasses can override this method to convert custom elements into standard Spring bean definitions, for example. Implementors have access to the parser's bean definition reader and the underlying XML resource, through the corresponding accessors.
| |
| preProcessXml | back to summary |
|---|---|
| protected void preProcessXml(Element root) Allow the XML to be extensible by processing any custom element types first, before we start to process the bean definitions. This method is a natural extension point for any other custom pre-processing of the XML. The default implementation is empty. Subclasses can override this method to convert custom elements into standard Spring bean definitions, for example. Implementors have access to the parser's bean definition reader and the underlying XML resource, through the corresponding accessors.
| |
| processAliasRegistration | back to summary |
|---|---|
| protected void processAliasRegistration(Element ele) Process the given alias element, registering the alias with the registry. | |
| processBeanDefinition | back to summary |
|---|---|
| protected void processBeanDefinition(Element ele, BeanDefinitionParserDelegate delegate) Process the given bean element, parsing the bean definition and registering it with the registry. | |
| registerBeanDefinitions | back to summary |
|---|---|
| public void registerBeanDefinitions(Document doc, XmlReaderContext readerContext) Implements org. This implementation parses bean definitions according to the "spring-beans" XSD (or DTD, historically). Opens a DOM Document; then initializes the default settings
specified at the
| |