org.springframework.boot.context.properties.bind.handler.IgnoreTopLevelConverterNotFoundBindHandler Java Examples

The following examples show how to use org.springframework.boot.context.properties.bind.handler.IgnoreTopLevelConverterNotFoundBindHandler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ConfigurationService.java    From spring-cloud-gateway with Apache License 2.0 6 votes vote down vote up
static <T> T bindOrCreate(Bindable<T> bindable,
		Map<String, Object> properties, String configurationPropertyName,
		Validator validator, ConversionService conversionService) {
	// see ConfigurationPropertiesBinder from spring boot for this definition.
	BindHandler handler = new IgnoreTopLevelConverterNotFoundBindHandler();

	if (validator != null) { // TODO: list of validators?
		handler = new ValidationBindHandler(handler, validator);
	}

	List<ConfigurationPropertySource> propertySources = Collections
			.singletonList(new MapConfigurationPropertySource(properties));

	return new Binder(propertySources, null, conversionService)
			.bindOrCreate(configurationPropertyName, bindable, handler);
}
 
Example #2
Source File: FunctionalConfigurationPropertiesBinder.java    From spring-fu with Apache License 2.0 4 votes vote down vote up
public <T> BindResult<T> bind(String prefix, Bindable<T> target) {
	UnboundElementsSourceFilter filter = new UnboundElementsSourceFilter();
	NoUnboundElementsBindHandler handler = new NoUnboundElementsBindHandler(new IgnoreTopLevelConverterNotFoundBindHandler(), filter);
	return binder.bind(prefix, target, handler);
}
 
Example #3
Source File: CustomizedConfigurationPropertiesBinder.java    From apollo-use-cases with Apache License 2.0 4 votes vote down vote up
public void bind(String configPrefix, Bindable<?> bean) {
  BindHandler handler = new IgnoreTopLevelConverterNotFoundBindHandler();
  this.binder.bind(configPrefix, bean, handler);
}