Example usage for org.springframework.beans BeanMetadataAttributeAccessor addMetadataAttribute

List of usage examples for org.springframework.beans BeanMetadataAttributeAccessor addMetadataAttribute

Introduction

In this page you can find the example usage for org.springframework.beans BeanMetadataAttributeAccessor addMetadataAttribute.

Prototype

public void addMetadataAttribute(BeanMetadataAttribute attribute) 

Source Link

Document

Add the given BeanMetadataAttribute to this accessor's set of attributes.

Usage

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

public void parseMetaElements(Element ele, BeanMetadataAttributeAccessor attributeAccessor) {
    NodeList nl = ele.getChildNodes();
    for (int i = 0; i < nl.getLength(); i++) {
        Node node = nl.item(i);// ww w .  j  av  a 2s. c  om
        if (isCandidateElement(node) && nodeNameEquals(node, META_ELEMENT)) {
            Element metaElement = (Element) node;
            String key = metaElement.getAttribute(KEY_ATTRIBUTE);
            String value = metaElement.getAttribute(VALUE_ATTRIBUTE);
            BeanMetadataAttribute attribute = new BeanMetadataAttribute(key, value);
            attribute.setSource(extractSource(metaElement));
            attributeAccessor.addMetadataAttribute(attribute);
        }
    }
}