@Test public void canResolvePlaceholdersInInclude() throws IOException { Map<String, String> overrides = ImmutableMap.of("CONFIG_LOCATION", "some_location"); String yaml = "${CONFIG_LOCATION:classpath:}/conf/environment/default.yaml"; String resolved = YamlConfigurationFormat.YAML.resolvePlaceholdersInText(yaml, overrides); assertThat(resolved, is("some_location/conf/environment/default.yaml")); }
@Override public String resolvePlaceholdersInText(String text, Map<String, String> overrides) { List<PlaceholderResolver.Placeholder> placeholders = extractPlaceholders(text); String resolvedText = text; for (PlaceholderResolver.Placeholder placeholder : placeholders) { resolvedText = resolvePlaceholderInText(resolvedText, placeholder, overrides); } return resolvedText; }
YamlConfigurationFormat implements ConfigurationFormat<YamlConfiguration> { @Override public String resolvePlaceholdersInText(String text, Map<String, String> overrides) { List<PlaceholderResolver.Placeholder> placeholders = extractPlaceholders(text); String resolvedText = text; for (PlaceholderResolver.Placeholder placeholder : placeholders) { resolvedText = resolvePlaceholderInText(resolvedText, placeholder, overrides); } return resolvedText; } }
YamlConfigurationFormat implements ConfigurationFormat<YamlConfiguration> { @Override public String resolvePlaceholdersInText(String text, Map<String, String> overrides) { List<PlaceholderResolver.Placeholder> placeholders = extractPlaceholders(text); String resolvedText = text; for (PlaceholderResolver.Placeholder placeholder : placeholders) { resolvedText = resolvePlaceholderInText(resolvedText, placeholder, overrides); } return resolvedText; } private  YamlConfigurationFormat(); }
YamlConfigurationFormat implements ConfigurationFormat<YamlConfiguration> { @Override public String resolvePlaceholdersInText(String text, Map<String, String> overrides) { List<PlaceholderResolver.Placeholder> placeholders = extractPlaceholders(text); String resolvedText = text; for (PlaceholderResolver.Placeholder placeholder : placeholders) { resolvedText = resolvePlaceholderInText(resolvedText, placeholder, overrides); } return resolvedText; } private  YamlConfigurationFormat(); @Override YamlConfiguration deserialise(String string); @Override YamlConfiguration deserialise(Resource resource); @Override String resolvePlaceholdersInText(String text, Map<String, String> overrides); @Override String toString(); }
YamlConfigurationFormat implements ConfigurationFormat<YamlConfiguration> { @Override public String resolvePlaceholdersInText(String text, Map<String, String> overrides) { List<PlaceholderResolver.Placeholder> placeholders = extractPlaceholders(text); String resolvedText = text; for (PlaceholderResolver.Placeholder placeholder : placeholders) { resolvedText = resolvePlaceholderInText(resolvedText, placeholder, overrides); } return resolvedText; } private  YamlConfigurationFormat(); @Override YamlConfiguration deserialise(String string); @Override YamlConfiguration deserialise(Resource resource); @Override String resolvePlaceholdersInText(String text, Map<String, String> overrides); @Override String toString(); static final YamlConfigurationFormat YAML; }