Java Properties convertResourceBundleToProperties(ResourceBundle resource)

Here you can find the source of convertResourceBundleToProperties(ResourceBundle resource)

Description

convert Resource Bundle To Properties

License

Open Source License

Declaration

public static Properties convertResourceBundleToProperties(ResourceBundle resource) 

Method Source Code


//package com.java2s;

import java.util.*;

public class Main {
    public static Properties convertResourceBundleToProperties(ResourceBundle resource) {
        Properties properties = null;
        if (resource != null) {
            properties = new Properties();
            Enumeration<String> keys = resource.getKeys();
            while (keys.hasMoreElements()) {
                String key = keys.nextElement();
                properties.put(key, resource.getString(key));
            }/*from ww w  .  ja va  2s . c  o  m*/
        }
        return properties;
    }
}

Related

  1. convertBundleToProperties(ResourceBundle rb)
  2. createScriptBodyFromScriptSet(Properties scriptSet)
  3. differentKeys(Properties p1, Properties p2)
  4. equalProps(Properties p1, Properties p2)
  5. extractFromPropertiesAsList(String prefix, Properties properties)