Browse Source

Remove setExtractOldValueForEditor at DataBinder level (to be deprecated in 4.3.5)

Issue: SPR-15009
pull/1267/merge
Juergen Hoeller 8 years ago
parent
commit
58eccfe5bd
  1. 20
      spring-context/src/main/java/org/springframework/validation/DataBinder.java

20
spring-context/src/main/java/org/springframework/validation/DataBinder.java

@ -144,14 +144,14 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter { @@ -144,14 +144,14 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter {
private String[] requiredFields;
private BindingErrorProcessor bindingErrorProcessor = new DefaultBindingErrorProcessor();
private final List<Validator> validators = new ArrayList<>();
private ConversionService conversionService;
private MessageCodesResolver messageCodesResolver;
private BindingErrorProcessor bindingErrorProcessor = new DefaultBindingErrorProcessor();
private final List<Validator> validators = new ArrayList<>();
/**
* Create a new DataBinder instance, with default object name.
@ -252,12 +252,14 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter { @@ -252,12 +252,14 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter {
protected AbstractPropertyBindingResult createBeanPropertyBindingResult() {
BeanPropertyBindingResult result = new BeanPropertyBindingResult(getTarget(),
getObjectName(), isAutoGrowNestedPaths(), getAutoGrowCollectionLimit());
if (this.conversionService != null) {
result.initConversion(this.conversionService);
}
if (this.messageCodesResolver != null) {
result.setMessageCodesResolver(this.messageCodesResolver);
}
return result;
}
@ -476,16 +478,6 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter { @@ -476,16 +478,6 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter {
return this.requiredFields;
}
/**
* Set whether to extract the old field value when applying a
* property editor to a new value for a field.
* <p>Default is "true", exposing previous field values to custom editors.
* Turn this to "false" to avoid side effects caused by getters.
*/
public void setExtractOldValueForEditor(boolean extractOldValueForEditor) {
getPropertyAccessor().setExtractOldValueForEditor(extractOldValueForEditor);
}
/**
* Set the strategy to use for resolving errors into message codes.
* Applies the given strategy to the underlying errors holder.

Loading…
Cancel
Save