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

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

Introduction

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

Prototype

public boolean isDefaultNamespace(Node node) 

Source Link

Document

Determine whether the given node indicates 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   www  .  j ava2s . c  om
    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  .  java  2s  .c o  m
 * @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);
    }
}