@Test public void resolvesPlaceholdersInIncludeFromMainYaml() throws Exception { String yaml = "" + "include: %s\n" + "resolution: \"resolved\"\n"; String include = "" + "myprop: \"${resolution}\"\n"; testYamlWithInclude(yaml, include, yamlConfig -> assertThat(yamlConfig.get("myprop", String.class), isValue("resolved"))); }
@Override public <T> Optional<T> get(String property, Class<T> tClass) { return nodeAt(property) .map(node -> { if (tClass == Path.class) { return (T) Paths.get(node.textValue()); } return parseNodeToClass(node, tClass); }); }
YamlConfiguration implements ExtensibleConfiguration<YamlConfiguration> { @Override public <T> Optional<T> get(String property, Class<T> tClass) { return nodeAt(property) .map(node -> { if (tClass == Path.class) { return (T) Paths.get(node.textValue()); } return parseNodeToClass(node, tClass); }); } }
YamlConfiguration implements ExtensibleConfiguration<YamlConfiguration> { @Override public <T> Optional<T> get(String property, Class<T> tClass) { return nodeAt(property) .map(node -> { if (tClass == Path.class) { return (T) Paths.get(node.textValue()); } return parseNodeToClass(node, tClass); }); } YamlConfiguration(JsonNode rootNode); }
YamlConfiguration implements ExtensibleConfiguration<YamlConfiguration> { @Override public <T> Optional<T> get(String property, Class<T> tClass) { return nodeAt(property) .map(node -> { if (tClass == Path.class) { return (T) Paths.get(node.textValue()); } return parseNodeToClass(node, tClass); }); } YamlConfiguration(JsonNode rootNode); @Override YamlConfiguration withParent(YamlConfiguration parent); @Override YamlConfiguration withOverrides(Map<String, String> overrides); @Override PlaceholderResolutionResult<YamlConfiguration> resolvePlaceholders(Map<String, String> overrides); @Override Optional<T> get(String property, Class<T> tClass); @Override X as(Class<X> type); @Override String toString(); JsonNode root(); }
YamlConfiguration implements ExtensibleConfiguration<YamlConfiguration> { @Override public <T> Optional<T> get(String property, Class<T> tClass) { return nodeAt(property) .map(node -> { if (tClass == Path.class) { return (T) Paths.get(node.textValue()); } return parseNodeToClass(node, tClass); }); } YamlConfiguration(JsonNode rootNode); @Override YamlConfiguration withParent(YamlConfiguration parent); @Override YamlConfiguration withOverrides(Map<String, String> overrides); @Override PlaceholderResolutionResult<YamlConfiguration> resolvePlaceholders(Map<String, String> overrides); @Override Optional<T> get(String property, Class<T> tClass); @Override X as(Class<X> type); @Override String toString(); JsonNode root();  }