Here you can find the source of convertBundleToProperties(ResourceBundle rb)
Parameter | Description |
---|---|
rb | a given resource bundle |
public static Properties convertBundleToProperties(ResourceBundle rb)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { /**/*from ww w . jav a2s .c o m*/ * Method to convert a ResourceBundle to a Properties object. * * @param rb a given resource bundle * @return Properties a populated properties object */ public static Properties convertBundleToProperties(ResourceBundle rb) { Properties props = new Properties(); for (Enumeration<String> keys = rb.getKeys(); keys.hasMoreElements();) { String key = keys.nextElement(); props.put(key, rb.getString(key)); } return props; } }