Here you can find the source of resolveCompositeKey(final String key, final Map
private static String resolveCompositeKey(final String key, final Map<String, Object> props)
//package com.java2s; //License from project: Apache License import java.util.Map; import java.util.Properties; import java.util.concurrent.Callable; public class Main { private static String resolveCompositeKey(final String key, final Properties props) { String value = null;// w w w. ja v a 2 s .c om // Look for the comma final int comma = key.indexOf(','); if (comma > -1) { // If we have a first part, try resolve it if (comma > 0) { // Check the first part final String key1 = key.substring(0, comma); if (props != null) { value = props.getProperty(key1); } else { value = System.getProperty(key1); } } // Check the second part, if there is one and first lookup failed if (value == null && comma < key.length() - 1) { final String key2 = key.substring(comma + 1); if (props != null) { value = props.getProperty(key2); } else { value = System.getProperty(key2); } } } // Return whatever we've found or null return value; } private static String resolveCompositeKey(final String key, final Map<String, Object> props) { String value = null; // Look for the comma final int comma = key.indexOf(','); if (comma > -1) { // If we have a first part, try resolve it if (comma > 0) { // Check the first part final String key1 = key.substring(0, comma); if (props != null) { Object o = props.get(key1); if (o instanceof Callable) { try { o = ((Callable) o).call(); } catch (final Exception e) { ; } } if (o != null) { value = String.valueOf(o); } } else { value = System.getProperty(key1); } } // Check the second part, if there is one and first lookup failed if (value == null && comma < key.length() - 1) { final String key2 = key.substring(comma + 1); if (props != null) { Object o = props.get(key2); if (o instanceof Callable) { try { o = ((Callable) o).call(); } catch (final Exception e) { ; } } if (o != null) { value = String.valueOf(o); } } else { value = System.getProperty(key2); } } } // Return whatever we've found or null return value; } }