0
点赞
收藏
分享

微信扫一扫

ResourceBundle 读取properties 配置文件

大雁f 2022-11-07 阅读 67


读取写入 map中

HashMap map = new HashMap();
ResourceBundle bundle = ResourceBundle.getBundle(resourceFileName);
java.util.Enumeration enums = bundle.getKeys();
while (enums.hasMoreElements()) {
String key = (String) enums.nextElement();
String value = bundle.getString(key);
map.put(key, value);
}
return map;

举报

相关推荐

0 条评论