Commit 2b1f6297 authored by Dave Syer's avatar Dave Syer Committed by Phillip Webb

Make ConfigurationPropertiesBindingPostProcessor Ordered

parent 2ba01008
......@@ -35,6 +35,7 @@ import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.EnvironmentAware;
import org.springframework.context.ResourceLoaderAware;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.core.convert.ConversionService;
import org.springframework.core.convert.converter.Converter;
......@@ -62,7 +63,7 @@ import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
*/
public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProcessor,
BeanFactoryAware, ResourceLoaderAware, EnvironmentAware, ApplicationContextAware,
InitializingBean, DisposableBean {
InitializingBean, DisposableBean, Ordered {
public static final String VALIDATOR_BEAN_NAME = "configurationPropertiesValidator";
......@@ -89,6 +90,23 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc
private ApplicationContext applicationContext;
private int order = Ordered.HIGHEST_PRECEDENCE;
/**
* @param order the order to set
*/
public void setOrder(int order) {
this.order = order;
}
/**
* @return the order
*/
@Override
public int getOrder() {
return this.order;
}
/**
* @param propertySources
*/
......
......@@ -32,7 +32,8 @@ import org.springframework.core.type.AnnotationMetadata;
public class ConfigurationPropertiesBindingPostProcessorRegistrar implements
ImportBeanDefinitionRegistrar {
public static final String BINDER_BEAN_NAME = "propertySourcesBinder";
public static final String BINDER_BEAN_NAME = ConfigurationPropertiesBindingPostProcessor.class
.getName();
@Override
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment