本文整理汇总了Java中org.springframework.beans.factory.support.ManagedProperties.setSource方法的典型用法代码示例。如果您正苦于以下问题:Java ManagedProperties.setSource方法的具体用法?Java ManagedProperties.setSource怎么用?Java ManagedProperties.setSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.beans.factory.support.ManagedProperties
的用法示例。
在下文中一共展示了ManagedProperties.setSource方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parsePropsElement
import org.springframework.beans.factory.support.ManagedProperties; //导入方法依赖的package包/类
/**
* Parse a props element.
*/
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;
}
示例2: parsePropsElement
import org.springframework.beans.factory.support.ManagedProperties; //导入方法依赖的package包/类
/**
* 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;
}