Polishing
This commit is contained in:
@@ -230,13 +230,13 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the type for the target object. When the target is {@code null},
|
* Set the type for the target object. When the target is {@code null},
|
||||||
* setting the targetType allows using {@link #construct} to
|
* setting the targetType allows using {@link #construct} to create the target.
|
||||||
* create the target.
|
|
||||||
* @param targetType the type of the target object
|
* @param targetType the type of the target object
|
||||||
* @since 6.1
|
* @since 6.1
|
||||||
|
* @see #construct
|
||||||
*/
|
*/
|
||||||
public void setTargetType(ResolvableType targetType) {
|
public void setTargetType(ResolvableType targetType) {
|
||||||
Assert.state(this.target == null, "targetType is used to for target creation, but target is already set");
|
Assert.state(this.target == null, "targetType is used to for target creation but target is already set");
|
||||||
this.targetType = targetType;
|
this.targetType = targetType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -458,8 +458,8 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter {
|
|||||||
* <p>Note that this setting only applies to <i>binding</i> operations
|
* <p>Note that this setting only applies to <i>binding</i> operations
|
||||||
* on this DataBinder, not to <i>retrieving</i> values via its
|
* on this DataBinder, not to <i>retrieving</i> values via its
|
||||||
* {@link #getBindingResult() BindingResult}.
|
* {@link #getBindingResult() BindingResult}.
|
||||||
* <p>Used for binding to fields with {@link #bind(PropertyValues)}, and not
|
* <p>Used for binding to fields with {@link #bind(PropertyValues)},
|
||||||
* applicable to constructor binding via {@link #construct},
|
* and not applicable to constructor binding via {@link #construct}
|
||||||
* which uses only the values it needs.
|
* which uses only the values it needs.
|
||||||
* @see #bind
|
* @see #bind
|
||||||
*/
|
*/
|
||||||
@@ -895,7 +895,7 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter {
|
|||||||
* @throws BeanInstantiationException in case of constructor failure
|
* @throws BeanInstantiationException in case of constructor failure
|
||||||
* @since 6.1
|
* @since 6.1
|
||||||
*/
|
*/
|
||||||
public final void construct(ValueResolver valueResolver) {
|
public void construct(ValueResolver valueResolver) {
|
||||||
Assert.state(this.target == null, "Target instance already available");
|
Assert.state(this.target == null, "Target instance already available");
|
||||||
Assert.state(this.targetType != null, "Target type not set");
|
Assert.state(this.targetType != null, "Target type not set");
|
||||||
|
|
||||||
@@ -1259,22 +1259,21 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Strategy to determine the name of the value to bind to a method parameter.
|
* Strategy to determine the name of the value to bind to a method parameter.
|
||||||
* Supported on constructor parameters with {@link #construct constructor
|
* Supported on constructor parameters with {@link #construct constructor binding}
|
||||||
* binding} which performs lookups via {@link ValueResolver#resolveValue}.
|
* which performs lookups via {@link ValueResolver#resolveValue}.
|
||||||
*/
|
*/
|
||||||
public interface NameResolver {
|
public interface NameResolver {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the name to use for the given method parameter, or {@code null}
|
* Return the name to use for the given method parameter, or {@code null}
|
||||||
* if unresolved. For constructor parameters, the name is determined via
|
* if unresolved. For constructor parameters, the name is determined via
|
||||||
* {@link org.springframework.core.DefaultParameterNameDiscoverer} if
|
* {@link org.springframework.core.DefaultParameterNameDiscoverer} if unresolved.
|
||||||
* unresolved.
|
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
String resolveName(MethodParameter parameter);
|
String resolveName(MethodParameter parameter);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Strategy for {@link #construct constructor binding} to look up the values
|
* Strategy for {@link #construct constructor binding} to look up the values
|
||||||
* to bind to a given constructor parameter.
|
* to bind to a given constructor parameter.
|
||||||
@@ -1291,7 +1290,6 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter {
|
|||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
Object resolveValue(String name, Class<?> type);
|
Object resolveValue(String name, Class<?> type);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user