|
|
|
|
@ -24,6 +24,7 @@ import org.springframework.boot.context.properties.source.ConfigurationProperty;
@@ -24,6 +24,7 @@ import org.springframework.boot.context.properties.source.ConfigurationProperty;
|
|
|
|
|
import org.springframework.boot.context.properties.source.ConfigurationPropertyName; |
|
|
|
|
import org.springframework.boot.context.properties.source.ConfigurationPropertyName.Form; |
|
|
|
|
import org.springframework.boot.context.properties.source.ConfigurationPropertySource; |
|
|
|
|
import org.springframework.boot.context.properties.source.ConfigurationPropertyState; |
|
|
|
|
import org.springframework.boot.context.properties.source.IterableConfigurationPropertySource; |
|
|
|
|
import org.springframework.core.CollectionFactory; |
|
|
|
|
import org.springframework.core.ResolvableType; |
|
|
|
|
@ -55,10 +56,12 @@ class MapBinder extends AggregateBinder<Map<Object, Object>> {
@@ -55,10 +56,12 @@ class MapBinder extends AggregateBinder<Map<Object, Object>> {
|
|
|
|
|
Map<Object, Object> map = CollectionFactory.createMap( |
|
|
|
|
(target.getValue() == null ? target.getType().resolve() : Map.class), 0); |
|
|
|
|
Bindable<?> resolvedTarget = resolveTarget(target); |
|
|
|
|
boolean hasDescendants = getContext().streamSources().anyMatch((source) -> source |
|
|
|
|
.containsDescendantOf(name) == ConfigurationPropertyState.PRESENT); |
|
|
|
|
for (ConfigurationPropertySource source : getContext().getSources()) { |
|
|
|
|
if (!ConfigurationPropertyName.EMPTY.equals(name)) { |
|
|
|
|
ConfigurationProperty property = source.getConfigurationProperty(name); |
|
|
|
|
if (property != null) { |
|
|
|
|
if (property != null && !hasDescendants) { |
|
|
|
|
Object value = getContext().getPlaceholdersResolver() |
|
|
|
|
.resolvePlaceholders(property.getValue()); |
|
|
|
|
return ResolvableTypeDescriptor.forType(target.getType()) |
|
|
|
|
|