Polish Binder constructor

Reinstate constructor signature used by Spring Cloud and improve
javadoc.

Closes gh-12095
This commit is contained in:
Phillip Webb 2018-02-20 15:36:43 -08:00
parent b5e2c5ec1c
commit cdb5677375
1 changed files with 16 additions and 1 deletions

View File

@ -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<ConfigurationPropertySource> 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<ConfigurationPropertySource> sources,
PlaceholdersResolver placeholdersResolver,