|
Generated by JDiff |
||||||||
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES |
This file contains all the changes in documentation in the packageorg.springframework.web.method.annotation
as colored differences. Deletions are shownlike this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.
Abstract base class for resolving method arguments from a named value. Request parameters, request headers, andClass AbstractNamedValueMethodArgumentResolver, constructor AbstractNamedValueMethodArgumentResolver(ConfigurableBeanFactory)path variables are examples ofnamednamed values. Each may have a name, a required flag, and a default value.Subclasses define how to do the following:
- Obtain named value information for a method parameter
- Resolve names into argument values
- Handle missing argument values when argument values are required
- Optionally handle a resolved value
A default value string can contain ${...} placeholders and Spring
ExpressionExpression Language #{...} expressions.For this to workaa ConfigurableBeanFactory must be supplied to the class constructor.A WebDataBinder is created to apply type conversion to the
resolvedresolved argument value if it doesn'tmatch the method parameter type.@author Arjen Poutsma @author Rossen Stoyanchev @since 3.1
@param beanFactory a bean factory to use for resolvingClass AbstractNamedValueMethodArgumentResolver, NamedValueInfo createNamedValueInfo(MethodParameter)${...}placeholderplaceholder and #{...} SpEL expressionsin default values, or {@code null} ifdefaultdefault values are not expected to contain expressions
Create the NamedValueInfo object for the given method parameter. ImplementationsClass AbstractNamedValueMethodArgumentResolver, void handleMissingValue(String, MethodParameter)typicallytypicallyretrieve the method annotation by means of MethodParameter.getParameterAnnotation(Class).@param parameter the method parameter @return the named value information
Invoked when a named value is required, but .resolveName(String, MethodParameter, NativeWebRequest)returned {@code null} and there is no default value. Subclasses typically throw an exception in this case. @param name the name for the value @param parameter the method parameter
An abstract base class adapting a WebArgumentResolver toClass AbstractWebArgumentResolverAdapter, Object resolveArgument(MethodParameter, ModelAndViewContainer, NativeWebRequest, WebDataBinderFactory)thethe HandlerMethodArgumentResolver contract.Note: This class is provided for backwards compatibility. However it is recommended to re-write a {@code WebArgumentResolver}
asas {@code HandlerMethodArgumentResolver}. Since .supportsParametercan only be implemented by actually resolving the value and thencheckingchecking the result is not {@code WebArgumentResolver#UNRESOLVED} anyexceptionsexceptions raised must be absorbed and ignored since it's not clear whether theadapteradapterdoesn't support the parameter or whether it failed for an internal reason.The {@code HandlerMethodArgumentResolver} contract also provides access to model attributes and to {@code WebDataBinderFactory} (for type conversion). @author Arjen Poutsma @author Rossen Stoyanchev @since 3.1
Delegate to the WebArgumentResolver instance. @exception IllegalStateException if the resolved value is notClass AbstractWebArgumentResolverAdapter, boolean supportsParameter(MethodParameter)assignableassignableto the method parameter.
Actually resolve the value and check the resolved value isnotnotWebArgumentResolver.UNRESOLVED absorbing _any_ exceptions.
Resolves Errors method arguments.An {@code Errors} method argument is expected to appear immediately after the model attribute in the method signature. It is resolved by expecting the last two attributes added to the model to be the model attribute and its BindingResult.
@author Rossen Stoyanchev @since 3.1
Class ExceptionHandlerMethodResolver, constructor ExceptionHandlerMethodResolver(Class<?>)GivenDiscoversa set ofExceptionHandler @ExceptionHandler methodsatininitialization,afindsgiven classthetype,best matching methodincluding all supermappedtypes, and helps to resolve anexception atException toruntime.themethod its mapped to. Exception mappings areextracteddefinedfrom thethroughmethod{@code @ExceptionHandler} annotation or by lookingforatThrowablethemethodsignaturearguments.ofan {@code @ExceptionHandler} method. @author Rossen Stoyanchev @since 3.1
A constructor that finds ExceptionHandler methods inClass ExceptionHandlerMethodResolver, Method resolveMethod(Exception)athe givenhandlertype. @param handlerType thehandler to inspect for exception handler methods. @throws IllegalStateException If an exceptiontypeis mapped to two methods. @throws IllegalArgumentException If an @ExceptionHandler method is not mappedtoany exceptions.introspect
Find a method to handle the given exception. Use ExceptionDepthComparatorClass ExceptionHandlerMethodResolver, MethodFilter EXCEPTION_HANDLER_METHODSIfif more than one matchis found, the best matchisselected via ExceptionDepthComparatorfound. @param exception the exception @returnan @ExceptionHandlera method,to handle the exception or {@code null}
A filter for selecting {@code @ExceptionHandler} methods.
Resolves Map method arguments and handles Map return values.A Map return value can be interpreted in more than one ways
dependingdepending on the presence of annotations like {@code @ModelAttribute}oror{@code @ResponseBody}. Therefore this handler should be configured after the handlers that support these annotations.@author Rossen Stoyanchev @since 3.1
Resolves method arguments annotated with {@code @ModelAttribute} and handles return values from methods annotated with {@code @ModelAttribute}.Class ModelAttributeMethodProcessor, constructor ModelAttributeMethodProcessor(boolean)Model attributes are obtained from the model or if not found
possiblypossibly created with a default constructor if it is available. Once created,thethe attributed is populated with request data via data binding andalsoalsovalidation may be applied if the argument is annotatedwithwith {@code @javax.validation.Valid}.When this handler is created with {@code annotationNotRequired=true},
any non-simple type argument and return value is regarded as amodelmodel attribute with or without the presence of an {@code @ModelAttribute}. @author Rossen Stoyanchev @since 3.1
@param annotationNotRequired if "true", non-simple method arguments and return values are considered model attributes with or withoutClass ModelAttributeMethodProcessor, boolean isBindExceptionRequired(WebDataBinder, MethodParameter)aa{@code @ModelAttribute} annotation.
Whether to raise a BindException onClass ModelAttributeMethodProcessor, Object resolveArgument(MethodParameter, ModelAndViewContainer, NativeWebRequest, WebDataBinderFactory)bind orvalidation errors.The@param binder the data binder used to perform data binding @paramdefaultparameter the methodimplementationargumentreturns@return {@code true} if the next methodargument is not of type Errors.@param binder the data binder used to perform data binding @param parameter the method argument
Resolve the argument from the model or if not found instantiate itClass ModelAttributeMethodProcessor, boolean supportsReturnType(MethodParameter)withwith its default if it is available. The model attribute is thenpopulatedpopulated with request values via data binding and optionally validated if {@code @java.validation.Valid} is present on the argument. @throws BindException if data binding and validation result in an error and the next method parameter is not of type Errors. @throws Exception if WebDataBinder initialization fails.
Return {@code true} if there is a method-level {@code @ModelAttribute}or if it is a non-simple type when {@code annotationNotRequired=true}.
Resolves Model arguments and handles Model return values.A Model return type has a set purpose. Therefore this
handlerhandler should be configured ahead of handlers that support any return valuetypetype annotated with {@code @ModelAttribute} or {@code @ResponseBody} to ensure they don't take over.@author Rossen Stoyanchev @since 3.1
Resolves Map method arguments annotated with {@code @RequestHeader}.For individual header values annotated with {@code @RequestHeader}seesee RequestHeaderMethodArgumentResolver instead.The created Map contains all request header name/value pairs.
The method parameter type may be a MultiValueMap to receive all values for a header, not only the first one.@author Arjen Poutsma @author Rossen Stoyanchev @since 3.1
Resolves Map method arguments annotated with an @RequestParam where the annotation doesnotnotspecify a request parameter name. See RequestParamMethodArgumentResolver for resolving Mapmethod arguments with a request parameter name.The created Map contains all request parameter name/value pairs. If the method parameter
typetype is MultiValueMap instead, the created map contains all request parameters and all there valuesforfor cases where request parameters have multiple values. @author Arjen Poutsma @author Rossen Stoyanchev @since 3.1 @see RequestParamMethodArgumentResolver
Resolves method arguments annotated with @RequestParam, argumentsClass RequestParamMethodArgumentResolver, constructor RequestParamMethodArgumentResolver(ConfigurableBeanFactory, boolean)ofof type MultipartFile in conjunction with Spring's MultipartResolverabstraction, and arguments of type {@code javax.servlet.http.Part} inconjunctionconjunction with Servlet 3.0 multipart requests. This resolver can also be created indefaultdefault resolution mode in which simple types (int, long, etc.) notannotatedannotated with @RequestParam are also treated as request parameters withthethe parameter name derived from the argument name.If the method parameter type is Map, the
request parametername specifiednamein the annotation is used toresolve the request parameter String value. The valueisis then converted to a Mapvia type conversion assuming asuitablesuitable Converter or PropertyEditor hasbeen registered.IfOr if a request parameter name is not specifiedwith a Map method parameter type, thethe RequestParamMapMethodArgumentResolver is used insteadprovidingto provide access to all request parameters in the form of a map.A WebDataBinder is invoked to apply type conversion to resolved
requestrequest header values that don't yet match the method parameter type.@author Arjen Poutsma @author Rossen Stoyanchev @since 3.1 @see RequestParamMapMethodArgumentResolver
@param beanFactory a bean factory used for resolving ${...}Class RequestParamMethodArgumentResolver, boolean supportsParameter(MethodParameter)placeholderplaceholderand #{...} SpEL expressions in default values, or {@code null} ifdefaultdefault values are not expected to contain expressions @param useDefaultResolution in default resolution mode a methodargumentargument that is a simple type, as defined in BeanUtils.isSimpleProperty,is treated as a request parameter even if it itsn't annotated,thethe request parameter name is derived from the method parameter name.
Supports the following:
- @RequestParam-annotated method arguments.
This excludes Map params where the annotation doesn'tt specify a name. See RequestParamMapMethodArgumentResolverinstead for such params.- Arguments of type MultipartFile
unless annotated with @RequestPart.- Arguments of type {@code javax.servlet.http.Part}
unless annotated with @RequestPart.- In default resolution mode, simple type
argumentsarguments even if not with @RequestParam.
Manages controller-specific session attributes declaredClass SessionAttributesHandler, constructor SessionAttributesHandler(Class<?>, SessionAttributeStore)viavia @SessionAttributes. Actual storageis performed viais delegated to a SessionAttributeStore.instance.When a controller annotated with {@code @SessionAttributes}
addsaddsattributes to its model, those attributes are checked against namesandand types specified via {@code @SessionAttributes}. Matching modelattributesattributes are saved in the HTTP session and remain there until the controllercallscalls SessionStatus.setComplete().@author Rossen Stoyanchev @since 3.1
Class SessionAttributesHandler, void cleanupAttributes(WebRequest)CreatesCreate a new instance for a controller type. Session attribute names/typesand types are extracted froma type-levelthe {@code @SessionAttributes}ifannotation, iffoundpresent, on the given type. @param handlerType the controller type @param sessionAttributeStore used for session access
Class SessionAttributesHandler, boolean hasSessionAttributes()CleansRemove "known" attributes from the session,-i.e. attributes listed by name in {@code @SessionAttributes}and previouslyorstored in theattributes previously stored in the modelthatat least oncematched by type. @param request the current request
Whether the controller represented by this instance has declaredClass SessionAttributesHandler, boolean isHandlerSessionAttribute(String, Class<?>)session attribute namesanyor typessessionof interest viaattributes through an SessionAttributes annotation.
Whether the attribute nameClass SessionAttributesHandler, Map<String, Object> retrieveAttributes(WebRequest)and/or type matchthose specified in thethe names and typescontroller'sspecified via {@code @SessionAttributes}annotation.inunderlyingcontroller.Attributes successfully resolved through this method are "remembered" and subsequently used in .retrieveAttributes(WebRequest)
andand .cleanupAttributes(WebRequest).In other words, retrieval and cleanup only affect attributes previously resolved through here.@param attributeName the attribute name to check; must,notneverbe{@codenullnull} @param attributeType the type for the attribute; or, possibly {@code null}
Retrieve "known" attributes from the session,Class SessionAttributesHandler, void storeAttributes(WebRequest, Map<String, ?>)--i.e. attributeslistedlistedby name in {@code @SessionAttributes}andorpreviously storedattributesin thepreviously stored in the modelthatat least oncematched by type.@param request the current request @return a map with handler session attributes;, possibly empty.
StoresStore a subset of the given attributes in the session. Attributesnotnotdeclared as session attributes via {@code @SessionAttributes} are ignored.@param request the current request @param attributes candidate attributes for session storage
Resolves a SessionStatus argument by obtaining itfromfromthe ModelAndViewContainer. @author Rossen Stoyanchev @since 3.1