类的使用
cn.taketoday.web.BindingContext
使用BindingContext的程序包
-
cn.taketoday.web中BindingContext的使用
声明为BindingContext的cn.taketoday.web中的字段修饰符和类型方法说明BindingContext.addAllAttributes(Map<String, ?> attributes) Copy all attributes to the underlying model.BindingContext.addAttribute(Object value) Add the supplied attribute to the underlying model.BindingContext.addAttribute(String name, Object value) Add the supplied attribute to the underlying model.DecoratingRequestContext.binding()RequestContext.binding()DecoratingRequestContext.getBinding()RequestContext.getBinding()BindingContext.mergeAttributes(Map<String, ?> attributes) Copy attributes in the suppliedMapwith existing objects of the same name taking precedence (i.e. not getting replaced).BindingContext.removeAttributes(Map<String, ?> attributes) Remove the given attributes from the model.参数类型为BindingContext的cn.taketoday.web中的方法修饰符和类型方法说明voidDecoratingRequestContext.setBinding(BindingContext bindingContext) voidRequestContext.setBinding(BindingContext bindingContext) -
cn.taketoday.web.handler.method中BindingContext的使用
修饰符和类型方法说明booleanModelHandler.ModelMethod.checkDependencies(BindingContext mavContainer) protected ObjectModelAttributeMethodProcessor.createAttribute(String attributeName, cn.taketoday.core.MethodParameter parameter, BindingContext bindingContext, RequestContext request) Extension point to create the model attribute if not found in the model, with subsequent parameter binding through bean properties (unless suppressed).protected ObjectModelAttributeMethodProcessor.createAttributeFromRequestValue(String sourceValue, String attributeName, cn.taketoday.core.MethodParameter parameter, BindingContext binderFactory, RequestContext request) Create a model attribute from a String request value (e.g.private ModelHandler.ModelMethodModelHandler.getNextModelMethod(BindingContext container, ArrayList<ModelHandler.ModelMethod> modelMethods) voidModelHandler.initModel(RequestContext request, BindingContext container, HandlerMethod handlerMethod) Populate the model in the following order: Retrieve "known" session attributes listed as@SessionAttributes.private voidModelHandler.invokeModelAttributeMethods(RequestContext request, BindingContext container, ArrayList<ModelHandler.ModelMethod> modelMethods) Invoke model attribute methods to populate the model.private voidModelHandler.updateBindingResult(RequestContext request, BindingContext bindingContext, cn.taketoday.ui.ModelMap model, SessionAttributesHandler sessionAttributesHandler) AddBindingResultattributes to the model for attributes that require it.voidModelHandler.updateModel(RequestContext request, BindingContext container, Class<?> handlerMethod) Promote model attributes listed as@SessionAttributesto the session.