/** * Extracts all placeholder resolver schemes that are referred from the configuration. */ public static Set<String> getSchemesForConfig(Map<String, String> props) { Set<String> schemes = new HashSet<String>(); for (Map.Entry<String, String> e : props.entrySet()) { String value = e.getValue(); schemes.addAll(getSchemeForValue(value)); } return schemes; }
/** * Extracts all placeholder resolver schemes that are referred from the value. */ public static Set<String> getSchemeForValue(String value) { Set<String> schemes = new HashSet<String>(); Matcher matcher = SCHEME_PATTERN.matcher(value); while (matcher.find()) { String scheme = matcher.group(1); schemes.add(scheme); String remaining = matcher.group(2); if (remaining != null) { schemes.addAll(getSchemeForValue(remaining)); } } return schemes; }