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

AbstractBeanDefinitionParser

abstract class AbstractBeanDefinitionParser : BeanDefinitionParser

Abstract BeanDefinitionParser implementation providing a number of convenience methods and a template method that subclasses must override to provide the actual parsing logic.

Use this BeanDefinitionParser implementation when you want to parse some arbitrarily complex XML into one or more BeanDefinition. If you just want to parse some XML into a single BeanDefinition, you may wish to consider the simpler convenience extensions of this class, namely AbstractSingleBeanDefinitionParser and AbstractSimpleBeanDefinitionParser.

Author
Rob Harrop

Author
Juergen Hoeller

Author
Rick Evans

Author
Dave Syer

Since
2.0

Constructors

<init>

AbstractBeanDefinitionParser()

Abstract BeanDefinitionParser implementation providing a number of convenience methods and a template method that subclasses must override to provide the actual parsing logic.

Use this BeanDefinitionParser implementation when you want to parse some arbitrarily complex XML into one or more BeanDefinition. If you just want to parse some XML into a single BeanDefinition, you may wish to consider the simpler convenience extensions of this class, namely AbstractSingleBeanDefinitionParser and AbstractSimpleBeanDefinitionParser.

Properties

ID_ATTRIBUTE

static val ID_ATTRIBUTE: String

Constant for the "id" attribute

NAME_ATTRIBUTE

static val NAME_ATTRIBUTE: String

Constant for the "name" attribute

Functions

parse

fun parse(element: Element, parserContext: ParserContext): BeanDefinition

Inheritors

AbstractSingleBeanDefinitionParser

abstract class AbstractSingleBeanDefinitionParser : AbstractBeanDefinitionParser

Base class for those BeanDefinitionParser implementations that need to parse and define just a single BeanDefinition.

Extend this parser class when you want to create a single bean definition from an arbitrarily complex XML element. You may wish to consider extending the AbstractSimpleBeanDefinitionParser when you want to create a single bean definition from a relatively simple custom XML element.

The resulting BeanDefinition will be automatically registered with the org.springframework.beans.factory.support.BeanDefinitionRegistry. Your job simply is to parse the custom XML Element into a single BeanDefinition.