use of org.springframework.boot.context.properties.source.IterableConfigurationPropertySource in project spring-boot by spring-projects.
the class IndexedElementsBinder method getKnownIndexedChildren.
private MultiValueMap<String, ConfigurationPropertyName> getKnownIndexedChildren(ConfigurationPropertySource source, ConfigurationPropertyName root) {
MultiValueMap<String, ConfigurationPropertyName> children = new LinkedMultiValueMap<>();
if (!(source instanceof IterableConfigurationPropertySource)) {
return children;
}
for (ConfigurationPropertyName name : (IterableConfigurationPropertySource) source.filter(root::isAncestorOf)) {
ConfigurationPropertyName choppedName = name.chop(root.getNumberOfElements() + 1);
if (choppedName.isLastElementIndexed()) {
String key = choppedName.getLastElement(Form.UNIFORM);
children.add(key, name);
}
}
return children;
}
Aggregations