public enum MvcParamFrom extends Enum<MvcParamFrom>
CookieValue,
MatrixVariable,
PathVariable,
RequestAttribute,
RequestBody,
RequestHeader,
RequestParam,
RequestPart| 枚举常量和说明 |
|---|
ATTR
Annotation to bind a method parameter to a request attribute.
|
BODY
Annotation indicating a method parameter should be bound to the body of the
web request.
|
COOKIE
Annotation which indicates that a method parameter should be bound to an HTTP
cookie.
|
HEADER
Annotation which indicates that a method parameter should be bound to a web
request header.
|
MATRIX
Annotation which indicates that a method parameter should be bound to a
name-value pair within a path segment.
|
PARAM
Annotation which indicates that a method parameter should be bound to a web
request parameter.
|
PART
Annotation that can be used to associate the part of a "multipart/form-data"
request with a method argument.
|
PATH
Annotation which indicates that a method parameter should be bound to a URI
template variable.
|
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
equals(MvcParamFrom from) |
boolean |
equals(String from) |
static List<Map<String,String>> |
fromList() |
String |
getDesc() |
String |
getKey() |
Map<String,String> |
toMap() |
static MvcParamFrom |
valueOf(String name)
返回带有指定名称的该类型的枚举常量。
|
static MvcParamFrom |
valueOfIgnoreCase(String from) |
static MvcParamFrom[] |
values()
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。
|
public static final MvcParamFrom COOKIE
CookieValuepublic static final MvcParamFrom MATRIX
RequestMapping
annotated handler methods in Servlet environments.MatrixVariablepublic static final MvcParamFrom PATH
RequestMapping annotated handler
methods in Servlet environments.PathVariablepublic static final MvcParamFrom ATTR
RequestAttributepublic static final MvcParamFrom BODY
HttpMessageConverter to resolve the method argument depending on the
content type of the request. Optionally, automatic validation can be applied
by annotating the argument with @Valid.RequestBodypublic static final MvcParamFrom HEADER
Supported for annotated handler methods in Servlet and Portlet environments.
If the method parameter is Map<String, String>,
MultiValueMap<String,
String>, or HttpHeaders then
the map is populated with all header names and values.
RequestHeaderpublic static final MvcParamFrom PARAM
Supported for annotated handler methods in Servlet and Portlet environments.
If the method parameter type is Map and a request parameter name is
specified, then the request parameter value is converted to a Map
assuming an appropriate conversion strategy is available.
If the method parameter is Map<String, String> or
MultiValueMap<String,
String> and a parameter name is not specified, then the map parameter is
populated with all request parameter names and values.
RequestParampublic static final MvcParamFrom PART
Supported method argument types include MultipartFile in conjunction
with Spring's MultipartResolver abstraction,
javax.servlet.http.Part in conjunction with Servlet 3.0 multipart
requests, or otherwise for any other method argument, the content of the part
is passed through an HttpMessageConverter taking into consideration
the 'Content-Type' header of the request part. This is analogous to
what @RequestBody does to resolve an argument based on the content of
a non-multipart regular request.
Note that @RequestParam annotation can also be used to associate the
part of a "multipart/form-data" request with a method argument supporting the
same method argument types. The main difference is that when the method
argument is not a String, @RequestParam relies on type conversion via
a registered Converter or PropertyEditor
while @RequestPart relies on HttpMessageConverters taking
into consideration the 'Content-Type' header of the request
part. @RequestParam is likely to be used with name-value form fields
while @RequestPart is likely to be used with parts containing more
complex content (e.g. JSON, XML).
RequestPartpublic static MvcParamFrom[] values()
for (MvcParamFrom c : MvcParamFrom.values()) System.out.println(c);
public static MvcParamFrom valueOf(String name)
name - 要返回的枚举常量的名称。IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量NullPointerException - 如果参数为空值public String getKey()
public String getDesc()
public boolean equals(MvcParamFrom from)
public boolean equals(String from)
public static MvcParamFrom valueOfIgnoreCase(String from)
Copyright © 2019. All rights reserved.