Example usage for org.springframework.beans.factory.xml BeanDefinitionParserDelegate parseBeanDefinitionAttributes

List of usage examples for org.springframework.beans.factory.xml BeanDefinitionParserDelegate parseBeanDefinitionAttributes

Introduction

In this page you can find the example usage for org.springframework.beans.factory.xml BeanDefinitionParserDelegate parseBeanDefinitionAttributes.

Prototype

public AbstractBeanDefinition parseBeanDefinitionAttributes(Element ele, String beanName,
        @Nullable BeanDefinition containingBean, AbstractBeanDefinition bd) 

Source Link

Document

Apply the attributes of the given bean element to the given bean * definition.

Usage

From source file:org.jdal.beans.CustomBeanDefinitionParser.java

/**
 * Parse bean like a real bean definition.
 * @param ele element//from  w  ww  .ja  v  a2  s.co  m
 * @param parserContext parserContext
 * @param builder builder
 */
protected void parseBeanDefinition(Element ele, ParserContext parserContext, BeanDefinitionBuilder builder) {
    BeanDefinitionParserDelegate delegate = parserContext.getDelegate();
    AbstractBeanDefinition bd = builder.getRawBeanDefinition();
    XmlReaderContext reader = parserContext.getReaderContext();

    try {
        delegate.parseBeanDefinitionAttributes(ele, beanName, null, bd);
        bd.setDescription(DomUtils.getChildElementValueByTagName(ele, "description"));

        delegate.parseMetaElements(ele, bd);
        delegate.parseLookupOverrideSubElements(ele, bd.getMethodOverrides());
        delegate.parseReplacedMethodSubElements(ele, bd.getMethodOverrides());

        delegate.parseConstructorArgElements(ele, bd);
        delegate.parsePropertyElements(ele, bd);
        delegate.parseQualifierElements(ele, bd);

    } catch (NoClassDefFoundError err) {
        reader.error("Class that bean class [" + this.beanClass + "] depends on not found", ele, err);
    } catch (Throwable ex) {
        reader.error("Unexpected failure during bean definition parsing", ele, ex);
    }

}