From cdb5677375756c120d9459f4f7e9258c172a2685 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 20 Feb 2018 15:36:43 -0800 Subject: [PATCH] Polish Binder constructor Reinstate constructor signature used by Spring Cloud and improve javadoc. Closes gh-12095 --- .../boot/context/properties/bind/Binder.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java index 881645564da..19d9c4734af 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java @@ -33,6 +33,7 @@ import java.util.stream.Stream; import java.util.stream.StreamSupport; import org.springframework.beans.PropertyEditorRegistry; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.boot.context.properties.source.ConfigurationProperty; import org.springframework.boot.context.properties.source.ConfigurationPropertyName; import org.springframework.boot.context.properties.source.ConfigurationPropertySource; @@ -103,6 +104,19 @@ public class Binder { this(sources, placeholdersResolver, null, null); } + /** + * Create a new {@link Binder} instance for the specified sources. + * @param sources the sources used for binding + * @param placeholdersResolver strategy to resolve any property place-holders + * @param conversionService the conversion service to convert values (or {@code null} + * to use {@link ApplicationConversionService}) + */ + public Binder(Iterable sources, + PlaceholdersResolver placeholdersResolver, + ConversionService conversionService) { + this(sources, placeholdersResolver, conversionService, null); + } + /** * Create a new {@link Binder} instance for the specified sources. * @param sources the sources used for binding @@ -110,7 +124,8 @@ public class Binder { * @param conversionService the conversion service to convert values (or {@code null} * to use {@link ApplicationConversionService}) * @param propertyEditorInitializer initializer used to configure the property editors - * that can convert values + * that can convert values (or {@code null} if no initialization is required). Often + * used to call {@link ConfigurableListableBeanFactory#copyRegisteredEditorsTo}. */ public Binder(Iterable sources, PlaceholdersResolver placeholdersResolver,