| java.lang.Object org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader
DefaultBeanDefinitionDocumentReader | public class DefaultBeanDefinitionDocumentReader implements BeanDefinitionDocumentReader(Code) | | Default implementation of the
BeanDefinitionDocumentReader interface.
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> doesn't need to be the root
element of the XML document: This class will parse all bean definition elements
in the XML file, not regarding the actual root element.
author: Rod Johnson author: Juergen Hoeller author: Rob Harrop author: Erik Wiersma since: 18.12.2003 |
Method Summary | |
protected BeanDefinitionParserDelegate | createHelper(XmlReaderContext readerContext, Element root) | protected Object | extractSource(Element ele) Invoke the
org.springframework.beans.factory.parsing.SourceExtractor to pull the
source metadata from the supplied
Element . | final protected XmlReaderContext | getReaderContext() Return the descriptor for the XML resource that this parser works on. | 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 root, BeanDefinitionParserDelegate delegate) Parse the elements at the root level in the document:
"import", "alias", "bean". | 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 doc, XmlReaderContext readerContext) Parses bean definitions according to the "spring-beans" DTD. |
ALIAS_ATTRIBUTE | final public static String ALIAS_ATTRIBUTE(Code) | | |
IMPORT_ELEMENT | final public static String IMPORT_ELEMENT(Code) | | |
NAME_ATTRIBUTE | final public static String NAME_ATTRIBUTE(Code) | | |
RESOURCE_ATTRIBUTE | final public static String RESOURCE_ATTRIBUTE(Code) | | |
logger | final protected Log logger(Code) | | |
getReaderContext | final protected XmlReaderContext getReaderContext()(Code) | | Return the descriptor for the XML resource that this parser works on.
|
importBeanDefinitionResource | protected void importBeanDefinitionResource(Element ele)(Code) | | Parse an "import" element and load the bean definitions
from the given resource into the bean factory.
|
parseBeanDefinitions | protected void parseBeanDefinitions(Element root, BeanDefinitionParserDelegate delegate)(Code) | | Parse the elements at the root level in the document:
"import", "alias", "bean".
Parameters: root - the DOM root element of the document |
postProcessXml | protected void postProcessXml(Element root)(Code) | | 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.
See Also: DefaultBeanDefinitionDocumentReader.getReaderContext() |
preProcessXml | protected void preProcessXml(Element root)(Code) | | 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.
See Also: DefaultBeanDefinitionDocumentReader.getReaderContext() |
processAliasRegistration | protected void processAliasRegistration(Element ele)(Code) | | Process the given alias element, registering the alias with the registry.
|
processBeanDefinition | protected void processBeanDefinition(Element ele, BeanDefinitionParserDelegate delegate)(Code) | | Process the given bean element, parsing the bean definition
and registering it with the registry.
|
registerBeanDefinitions | public void registerBeanDefinitions(Document doc, XmlReaderContext readerContext)(Code) | | Parses bean definitions according to the "spring-beans" DTD.
Opens a DOM Document; then initializes the default settings
specified at <beans> level; then parses
the contained bean definitions.
|
|
|