Example usage for org.springframework.ide.eclipse.osgi.blueprint.internal.support OrderedManagedProperties OrderedManagedProperties

List of usage examples for org.springframework.ide.eclipse.osgi.blueprint.internal.support OrderedManagedProperties OrderedManagedProperties

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.osgi.blueprint.internal.support OrderedManagedProperties OrderedManagedProperties.

Prototype

OrderedManagedProperties

Source Link

Usage

From source file:org.springframework.ide.eclipse.osgi.blueprint.internal.BlueprintParser.java

/**
 * Parse a props element./*from w  ww.  j  av a2  s.c  om*/
 */
public Properties parsePropsElement(Element propsEle) {
    ManagedProperties props = new OrderedManagedProperties();
    props.setSource(extractSource(propsEle));
    props.setMergeEnabled(parseMergeAttribute(propsEle));

    List<Element> propEles = DomUtils.getChildElementsByTagName(propsEle,
            BeanDefinitionParserDelegate.PROP_ELEMENT);
    for (Iterator<Element> it = propEles.iterator(); it.hasNext();) {
        Element propEle = it.next();
        String key = propEle.getAttribute(BeanDefinitionParserDelegate.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;
}