Search in sources :

Example 1 with PropertyEntry

use of org.springframework.beans.factory.parsing.PropertyEntry in project spring-framework by spring-projects.

the class BeanDefinitionParserDelegate method parsePropertyElement.

/**
	 * Parse a property element.
	 */
public void parsePropertyElement(Element ele, BeanDefinition bd) {
    String propertyName = ele.getAttribute(NAME_ATTRIBUTE);
    if (!StringUtils.hasLength(propertyName)) {
        error("Tag 'property' must have a 'name' attribute", ele);
        return;
    }
    this.parseState.push(new PropertyEntry(propertyName));
    try {
        if (bd.getPropertyValues().contains(propertyName)) {
            error("Multiple 'property' definitions for property '" + propertyName + "'", ele);
            return;
        }
        Object val = parsePropertyValue(ele, bd, propertyName);
        PropertyValue pv = new PropertyValue(propertyName, val);
        parseMetaElements(ele, pv);
        pv.setSource(extractSource(ele));
        bd.getPropertyValues().addPropertyValue(pv);
    } finally {
        this.parseState.pop();
    }
}
Also used : PropertyEntry(org.springframework.beans.factory.parsing.PropertyEntry) PropertyValue(org.springframework.beans.PropertyValue)

Aggregations

PropertyValue (org.springframework.beans.PropertyValue)1 PropertyEntry (org.springframework.beans.factory.parsing.PropertyEntry)1