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

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

Introduction

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

Prototype

@Nullable
public BeanDefinition parseCustomElement(Element ele) 

Source Link

Document

Parse a custom element (outside of the default namespace).

Usage

From source file:com.predic8.membrane.core.config.spring.AbstractParser.java

protected void parseElementToProperty(Element ele, ParserContext parserContext, BeanDefinitionBuilder builder,
        String property) {/*from   w ww  .j a  v a  2  s . c  o m*/
    BeanDefinitionParserDelegate delegate = parserContext.getDelegate();

    if (delegate.isDefaultNamespace(ele)) {
        Object o = delegate.parsePropertySubElement(ele, builder.getBeanDefinition());
        builder.addPropertyValue(property, o);
    } else {
        BeanDefinition bd = delegate.parseCustomElement(ele);
        builder.addPropertyValue(property, bd);
    }
}

From source file:org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.java

/**
 * Parse the elements at the root level in the document:
 * "import", "alias", "bean".//from   w  w  w  .jav  a2 s.c om
 * @param root the DOM root element of the document
 */
protected void parseBeanDefinitions(Element root, BeanDefinitionParserDelegate delegate) {
    if (delegate.isDefaultNamespace(root)) {
        NodeList nl = root.getChildNodes();
        for (int i = 0; i < nl.getLength(); i++) {
            Node node = nl.item(i);
            if (node instanceof Element) {
                Element ele = (Element) node;
                if (delegate.isDefaultNamespace(ele)) {
                    parseDefaultElement(ele, delegate);
                } else {
                    delegate.parseCustomElement(ele);
                }
            }
        }
    } else {
        delegate.parseCustomElement(root);
    }
}