public class BindingContext
extends java.lang.Object
Model
with controller-specific attributes.
Provides methods to create a WebExchangeDataBinder
for a specific
target, command Object to apply data binding and validation to, or without a
target Object for simple type conversion from request values.
Container for the default model for the request.
Modifier and Type | Field and Description |
---|---|
private WebBindingInitializer |
initializer |
private Model |
model |
Constructor and Description |
---|
BindingContext()
Create a new
BindingContext . |
BindingContext(WebBindingInitializer initializer)
Create a new
BindingContext with the given initializer. |
Modifier and Type | Method and Description |
---|---|
WebExchangeDataBinder |
createDataBinder(ServerWebExchange exchange,
java.lang.Object target,
java.lang.String name)
Create a
WebExchangeDataBinder to apply data binding and
validation with on the target, command object. |
WebExchangeDataBinder |
createDataBinder(ServerWebExchange exchange,
java.lang.String name)
Create a
WebExchangeDataBinder without a target object for type
conversion of request values to simple types. |
Model |
getModel()
Return the default model.
|
protected WebExchangeDataBinder |
initDataBinder(WebExchangeDataBinder binder,
ServerWebExchange exchange)
Initialize the data binder instance for the given exchange.
|
@Nullable private final WebBindingInitializer initializer
private final Model model
public BindingContext()
BindingContext
.public BindingContext(@Nullable WebBindingInitializer initializer)
BindingContext
with the given initializer.initializer
- the binding initializer to apply (may be null
)public Model getModel()
public WebExchangeDataBinder createDataBinder(ServerWebExchange exchange, @Nullable java.lang.Object target, java.lang.String name)
WebExchangeDataBinder
to apply data binding and
validation with on the target, command object.exchange
- the current exchangetarget
- the object to create a data binder forname
- the name of the target objectprotected WebExchangeDataBinder initDataBinder(WebExchangeDataBinder binder, ServerWebExchange exchange)
public WebExchangeDataBinder createDataBinder(ServerWebExchange exchange, java.lang.String name)
WebExchangeDataBinder
without a target object for type
conversion of request values to simple types.exchange
- the current exchangename
- the name of the target object