Search in sources :

Example 1 with ManagedProperties

use of org.springframework.beans.factory.support.ManagedProperties in project spring-framework by spring-projects.

the class BeanDefinitionParserDelegate method parsePropsElement.

/**
	 * Parse a props element.
	 */
public Properties parsePropsElement(Element propsEle) {
    ManagedProperties props = new ManagedProperties();
    props.setSource(extractSource(propsEle));
    props.setMergeEnabled(parseMergeAttribute(propsEle));
    List<Element> propEles = DomUtils.getChildElementsByTagName(propsEle, PROP_ELEMENT);
    for (Element propEle : propEles) {
        String key = propEle.getAttribute(KEY_ATTRIBUTE);
        // Trim the text value to avoid unwanted whitespace
        // caused by typical XML formatting.
        String value = DomUtils.getTextValue(propEle).trim();
        TypedStringValue keyHolder = new TypedStringValue(key);
        keyHolder.setSource(extractSource(propEle));
        TypedStringValue valueHolder = new TypedStringValue(value);
        valueHolder.setSource(extractSource(propEle));
        props.put(keyHolder, valueHolder);
    }
    return props;
}
Also used : ManagedProperties(org.springframework.beans.factory.support.ManagedProperties) Element(org.w3c.dom.Element) TypedStringValue(org.springframework.beans.factory.config.TypedStringValue)

Aggregations

TypedStringValue (org.springframework.beans.factory.config.TypedStringValue)1 ManagedProperties (org.springframework.beans.factory.support.ManagedProperties)1 Element (org.w3c.dom.Element)1