Class PropertyPlaceholderHelper的使用

1.代码

1 private static Properties properties = new Properties();
1 public static String getProperties(String key) {
2         PropertyPlaceholderHelper propertyPlaceholderHelper = new PropertyPlaceholderHelper(PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_PREFIX, PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_SUFFIX);
3         if(properties.containsKey(key)){
4             return propertyPlaceholderHelper.replacePlaceholders(PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_PREFIX + key + PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_SUFFIX, properties);
5         }else{
6             return "";
7         }
8     }
原文地址:https://www.cnblogs.com/juncaoit/p/7838097.html