Model before controller method
invocation and with updates to it after the invocation.
On initialization the model is populated with attributes temporarily stored
in the session and through the invocation of @ModelAttribute methods.
On update model attributes are synchronized with the session and also
BindingResult attributes are added if missing.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final WebDataBinderFactory | |
| private static final Log | |
| private final List | |
| private final SessionAttributesHandler |
| Access | Constructor and Description |
|---|---|
| public | ModelFactory(List<InvocableHandlerMethod>
the handlerMethods, WebDataBinderFactory @ModelAttribute methods to invokefor preparation of binderFactory, SessionAttributesHandler BindingResult attributesfor access to session attributes attributeHandler)Create a new instance with the given |
| Modifier and Type | Method and Description |
|---|---|
| private List | findSessionAttributeArguments(HandlerMethod handlerMethod)
Find |
| public static String | Returns: the derived namea descriptor for the method parameter parameter)Derive the model attribute name for the given method parameter based on
a |
| public static String | Returns: the derived name (nevernull or empty String)the value returned from a method invocation returnValue, MethodParameter a descriptor for the return type of the method returnType)Derive the model attribute name for the given return value. |
| private ModelFactory. | |
| public void | initModel(NativeWebRequest
the current request request, ModelAndViewContainer a container with the model to be initialized container, HandlerMethod the method for which the model is initialized handlerMethod)Populate the model in the following order:
|
| private void | invokeModelAttributeMethods(NativeWebRequest request, ModelAndViewContainer container)
Invoke model attribute methods to populate the model. |
| private boolean | isBindingCandidate(String attributeName, Object value)
Whether the given attribute requires a |
| private void | updateBindingResult(NativeWebRequest request, ModelMap model)
Add |
| public void | updateModel(NativeWebRequest
the current request request, ModelAndViewContainer contains the model to update container)Promote model attributes listed as |
| dataBinderFactory | back to summary |
|---|---|
| private final WebDataBinderFactory dataBinderFactory | |
| logger | back to summary |
|---|---|
| private static final Log logger | |
| modelMethods | back to summary |
|---|---|
| private final List<ModelFactory. | |
| sessionAttributesHandler | back to summary |
|---|---|
| private final SessionAttributesHandler sessionAttributesHandler | |
| ModelFactory | back to summary |
|---|---|
| public ModelFactory(List<InvocableHandlerMethod> handlerMethods, WebDataBinderFactory binderFactory, SessionAttributesHandler attributeHandler) Create a new instance with the given
| |
| findSessionAttributeArguments | back to summary |
|---|---|
| private List Find | |
| getNameForParameter | back to summary |
|---|---|
| public static String getNameForParameter(MethodParameter parameter) Derive the model attribute name for the given method parameter based on
a
| |
| getNameForReturnValue | back to summary |
|---|---|
| public static String getNameForReturnValue(Object returnValue, MethodParameter returnType) Derive the model attribute name for the given return value. Results will be based on:
| |
| getNextModelMethod | back to summary |
|---|---|
| private ModelFactory. | |
| initModel | back to summary |
|---|---|
| public void initModel(NativeWebRequest request, ModelAndViewContainer container, HandlerMethod handlerMethod) throws Exception Populate the model in the following order:
| |
| invokeModelAttributeMethods | back to summary |
|---|---|
| private void invokeModelAttributeMethods(NativeWebRequest request, ModelAndViewContainer container) throws Exception Invoke model attribute methods to populate the model. Attributes are added only if not already present in the model. | |
| isBindingCandidate | back to summary |
|---|---|
| private boolean isBindingCandidate(String attributeName, Object value) Whether the given attribute requires a | |
| updateBindingResult | back to summary |
|---|---|
| private void updateBindingResult(NativeWebRequest request, ModelMap model) throws Exception Add | |
| updateModel | back to summary |
|---|---|
| public void updateModel(NativeWebRequest request, ModelAndViewContainer container) throws Exception Promote model attributes listed as
| |
| Modifier and Type | Field and Description |
|---|---|
| private final Set | |
| private final InvocableHandlerMethod |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public InvocableHandlerMethod | |
| public String |
| dependencies | back to summary |
|---|---|
| private final Set<String> dependencies | |
| handlerMethod | back to summary |
|---|---|
| private final InvocableHandlerMethod handlerMethod | |
| ModelMethod | back to summary |
|---|---|
| public ModelMethod(InvocableHandlerMethod handlerMethod) | |
| checkDependencies | back to summary |
|---|---|
| public boolean checkDependencies(ModelAndViewContainer mavContainer) | |
| getHandlerMethod | back to summary |
|---|---|
| public InvocableHandlerMethod getHandlerMethod() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |