org.springframework.validation.DataBinder to perform data
binding from URL query parameters or form data in the request data to Java objects.Warning
Data binding can lead to security issues by exposing parts of the object graph that are not meant to be accessed or modified by external clients. Therefore the design and use of data binding should be considered carefully with regard to security. For more details, please refer to the dedicated sections on data binding for Spring Web MVC and Spring WebFlux in the reference manual.
| Modifier and Type | Class and Description |
|---|---|
| private static record | WebExchangeDataBinder.MapValueResolver
Resolve values from a map. |
| Access | Constructor and Description |
|---|---|
| public | WebExchangeDataBinder(Object
the target object to bind onto (or target)null if the
binder is just used to convert a plain parameter value)Create a new instance, with default object name. |
| public | WebExchangeDataBinder(Object
the target object to bind onto (or target, String null if the
binder is just used to convert a plain parameter value)the name of the target object objectName)Create a new instance. |
| Modifier and Type | Method and Description |
|---|---|
| protected static void | |
| public Mono | Returns: aMono<Void> that completes when binding is completethe current exchange exchange)Bind query parameters, form data, or multipart form data to the binder target. |
| public Mono | Returns: aMono<Void> that completes when the target is createdthe request to bind exchange)Use a default or single data constructor to create the target by binding request parameters, multipart files, or parts to constructor args. |
| public static Mono | Returns: aMono with the values to bindthe current exchange exchange)Combine query params and form data for multipart form data from the body
of the request into a |
| public Mono | Returns: a map of bind valuesthe current exchange exchange)Obtain the values for data binding. |
| protected boolean | shouldConstructArgument(MethodParameter param)
Overrides org. |
| WebExchangeDataBinder | back to summary |
|---|---|
| public WebExchangeDataBinder(Object target) Create a new instance, with default object name.
| |
| WebExchangeDataBinder | back to summary |
|---|---|
| public WebExchangeDataBinder(Object target, String objectName) Create a new instance. | |
| addBindValue | back to summary |
|---|---|
| protected static void addBindValue(Map<String, Object> params, String key, List<?> values) | |
| bind | back to summary |
|---|---|
| public Mono Bind query parameters, form data, or multipart form data to the binder target.
| |
| construct | back to summary |
|---|---|
| public Mono Use a default or single data constructor to create the target by binding request parameters, multipart files, or parts to constructor args. After the call, use
| |
| extractValuesToBind | back to summary |
|---|---|
| public static Mono Combine query params and form data for multipart form data from the body
of the request into a
| |
| getValuesToBind | back to summary |
|---|---|
| public Mono Obtain the values for data binding. By default, this delegates to
| |
| shouldConstructArgument | back to summary |
|---|---|
| protected boolean shouldConstructArgument(MethodParameter param) Overrides org. Doc from org. Whether to instantiate the constructor argument of the given type, matching its own constructor arguments to bind values. By default, simple value types, maps, collections, and arrays are excluded from nested constructor binding initialization.
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public final boolean | equals(Object
the reference object with which to compare. o)Implements abstract java. |
| public Set | getNames()
Implements org. |
| public final int | |
| public Map | |
| public Object | resolveValue(String
the name to use for the lookup, possibly a nested path
for constructor parameters on nested objects name, Class<?> the target type, based on the constructor parameter type type)Implements org. |
| public final String | toString()
Implements abstract java. |
| map | back to summary |
|---|---|
| private final Map<String, Object> map Record Component accessed by map(). | |
| MapValueResolver | back to summary |
|---|---|
| private MapValueResolver(Map<String, Object> map) | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| getNames | back to summary |
|---|---|
| public Set Implements org. Doc from org. Return the names of all property values.
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of
| |
| map | back to summary |
|---|---|
| public Map Record Component getter of map. | |
| resolveValue | back to summary |
|---|---|
| public Object resolveValue(String name, Class<?> type) Implements org. Doc from org. Resolve the value for the given name and target parameter type. | |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.
| |