Example usage for org.springframework.beans.factory.support ManagedProperties setSource

List of usage examples for org.springframework.beans.factory.support ManagedProperties setSource

Introduction

In this page you can find the example usage for org.springframework.beans.factory.support ManagedProperties setSource.

Prototype

public void setSource(@Nullable Object source) 

Source Link

Document

Set the configuration source Object for this metadata element.

Usage

From source file:org.eclipse.gemini.blueprint.blueprint.config.internal.BlueprintParser.java

/**
 * Parse a props element.//  w  w  w .j av a  2 s .  co  m
 */
public Properties parsePropsElement(Element propsEle) {
    ManagedProperties props = new OrderedManagedProperties();
    props.setSource(extractSource(propsEle));
    props.setMergeEnabled(parseMergeAttribute(propsEle));

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

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

/**
 * Parse a props element./* ww  w  .  ja va  2  s  .c o  m*/
 */
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;
}

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

/**
 * Parse a props element.//  w  ww.j  a  va  2  s.  c  o m
 */
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;
}