本文整理汇总了Java中java.util.PropertyResourceBundle.keySet方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyResourceBundle.keySet方法的具体用法?Java PropertyResourceBundle.keySet怎么用?Java PropertyResourceBundle.keySet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.PropertyResourceBundle
的用法示例。
在下文中一共展示了PropertyResourceBundle.keySet方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createKeyValueArray
import java.util.PropertyResourceBundle; //导入方法依赖的package包/类
private final String[] createKeyValueArray(PropertyResourceBundle b) {
List<String> keyValueList = new ArrayList<String>();
StringBuilder sb = new StringBuilder();
for (String key : b.keySet()) {
sb.setLength(0);
sb.append(key);
sb.append(" = ");
sb.append(b.getString(key));
keyValueList.add(sb.toString());
}
String[] keyValueArray = keyValueList.toArray(new String[0]);
Arrays.sort(keyValueArray);
return keyValueArray;
}
示例2: generatePropertiesMap
import java.util.PropertyResourceBundle; //导入方法依赖的package包/类
private void generatePropertiesMap(String propertiesFile) {
try {
if (!new File(path+"/"+propertiesFile).exists()) return;
FileInputStream fileInputStream = new FileInputStream(path+"/"+propertiesFile);
PropertyResourceBundle propertyResourceBundle = new PropertyResourceBundle(fileInputStream);
for(String s : propertyResourceBundle.keySet()){
properties.put(s, new String(propertyResourceBundle.getString(s).getBytes("ISO-8859-1"),"UTF-8"));
}
} catch (Exception e) {
FLog.e("error trying to read properties file", e);
}
}
示例3: loadPluginResources
import java.util.PropertyResourceBundle; //导入方法依赖的package包/类
private void loadPluginResources(String resourceName, ResourceType type) {
try {
PropertyResourceBundle prbPlugin = (PropertyResourceBundle) ResourceBundle.getBundle(resourceName,
Locale.getDefault(), classLoader);
for (String key : prbPlugin.keySet()) {
PluginRes.putRes(key, prbPlugin.getString(key), type);
}
} catch (Exception ex) {
Log.debug(resourceName + "is not overwritten in plugin ");
}
}
示例4: loadConfigurationFrom
import java.util.PropertyResourceBundle; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public Configuration loadConfigurationFrom(InputStream input) throws IOException, HorizonDBException {
PropertyResourceBundle resourceBundle = new PropertyResourceBundle(input);
Builder builder = Configuration.newBuilder();
for (String key : resourceBundle.keySet()) {
setProperty(builder, key, resourceBundle.getString(key));
}
return builder.build();
}