Java Properties propertiesToJson(Properties properties)

Here you can find the source of propertiesToJson(Properties properties)

Description

properties To Json

License

Apache License

Declaration

public static Object propertiesToJson(Properties properties) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.*;

public class Main {
    public static Object propertiesToJson(Properties properties) {
        Map<String, String> jsonObj = new HashMap<String, String>();
        if (properties != null) {
            Set<String> keys = properties.stringPropertyNames();
            for (String key : keys) {
                jsonObj.put(key, properties.getProperty(key));
            }/*from  w w w  . j a v a 2 s  .c  o m*/
        }
        return jsonObj;
    }
}

Related

  1. isSupportedJVM(Map jdkProperties)
  2. maskApplicationEnvProperties(Map environmentVariables, Set variablesToMask)
  3. mergePropertiesIntoMap(Properties props, Map map)
  4. mergePropertiesIntoMap(Properties props, Map map)
  5. mergeSystemProperties(Properties properties)
  6. propertiesToMap(Properties props)
  7. putAll(final Map props, final Properties p)
  8. putAll(Properties properties, Map result)
  9. putPrefixToProperties(String prefix, Properties pro)