Skip to content

Commit 8416752

Browse files
committed
Polish Javadoc for MVC parameter binding annotations
1 parent 34204d2 commit 8416752

File tree

4 files changed

+36
-30
lines changed

4 files changed

+36
-30
lines changed

spring-web/src/main/java/org/springframework/web/bind/annotation/CookieValue.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
* <p>Supported for annotated handler methods in Servlet and Portlet environments.
3131
*
3232
* <p>The method parameter may be declared as type {@link javax.servlet.http.Cookie}
33-
* or as cookie value type (String, int, etc).
33+
* or as cookie value type (String, int, etc.).
3434
*
3535
* @author Juergen Hoeller
3636
* @author Sam Brannen
@@ -62,19 +62,20 @@
6262
String name() default "";
6363

6464
/**
65-
* Whether the header is required.
66-
* <p>Default is {@code true}, leading to an exception being thrown
67-
* in case the header is missing in the request. Switch this to
68-
* {@code false} if you prefer a {@code null} in case of the
69-
* missing header.
70-
* <p>Alternatively, provide a {@link #defaultValue}, which implicitly sets
71-
* this flag to {@code false}.
65+
* Whether the cookie is required.
66+
* <p>Defaults to {@code true}, leading to an exception being thrown
67+
* if the cookie is missing in the request. Switch this to
68+
* {@code false} if you prefer a {@code null} value if the cookie is
69+
* not present in the request.
70+
* <p>Alternatively, provide a {@link #defaultValue}, which implicitly
71+
* sets this flag to {@code false}.
7272
*/
7373
boolean required() default true;
7474

7575
/**
76-
* The default value to use as a fallback. Supplying a default value implicitly
77-
* sets {@link #required} to {@code false}.
76+
* The default value to use as a fallback.
77+
* <p>Supplying a default value implicitly sets {@link #required} to
78+
* {@code false}.
7879
*/
7980
String defaultValue() default ValueConstants.DEFAULT_NONE;
8081

spring-web/src/main/java/org/springframework/web/bind/annotation/RequestHeader.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
*
3030
* <p>Supported for annotated handler methods in Servlet and Portlet environments.
3131
*
32-
* <p>If the method parameter is {@link java.util.Map Map&lt;String, String&gt;} or
32+
* <p>If the method parameter is {@link java.util.Map Map&lt;String, String&gt;},
3333
* {@link org.springframework.util.MultiValueMap MultiValueMap&lt;String, String&gt;},
3434
* or {@link org.springframework.http.HttpHeaders HttpHeaders} then the map is
3535
* populated with all header names and values.
@@ -63,17 +63,19 @@
6363

6464
/**
6565
* Whether the header is required.
66-
* <p>Default is {@code true}, leading to an exception thrown in case
67-
* of the header missing in the request. Switch this to {@code false}
68-
* if you prefer a {@code null} in case of the header missing.
69-
* <p>Alternatively, provide a {@link #defaultValue}, which implicitly sets
70-
* this flag to {@code false}.
66+
* <p>Defaults to {@code true}, leading to an exception being thrown
67+
* if the header is missing in the request. Switch this to
68+
* {@code false} if you prefer a {@code null} value if the header is
69+
* not present in the request.
70+
* <p>Alternatively, provide a {@link #defaultValue}, which implicitly
71+
* sets this flag to {@code false}.
7172
*/
7273
boolean required() default true;
7374

7475
/**
75-
* The default value to use as a fallback. Supplying a default value implicitly
76-
* sets {@link #required} to {@code false}.
76+
* The default value to use as a fallback.
77+
* <p>Supplying a default value implicitly sets {@link #required} to
78+
* {@code false}.
7779
*/
7880
String defaultValue() default ValueConstants.DEFAULT_NONE;
7981

spring-web/src/main/java/org/springframework/web/bind/annotation/RequestParam.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,20 @@
7171

7272
/**
7373
* Whether the parameter is required.
74-
* <p>Default is {@code true}, leading to an exception thrown in case
75-
* of the parameter missing in the request. Switch this to {@code false}
76-
* if you prefer a {@code null} in case of the parameter missing.
77-
* <p>Alternatively, provide a {@link #defaultValue() defaultValue},
78-
* which implicitly sets this flag to {@code false}.
74+
* <p>Defaults to {@code true}, leading to an exception being thrown
75+
* if the parameter is missing in the request. Switch this to
76+
* {@code false} if you prefer a {@code null} value if the parameter is
77+
* not present in the request.
78+
* <p>Alternatively, provide a {@link #defaultValue}, which implicitly
79+
* sets this flag to {@code false}.
7980
*/
8081
boolean required() default true;
8182

8283
/**
83-
* The default value to use as a fallback when the request parameter value
84-
* is not provided or empty. Supplying a default value implicitly sets
85-
* {@link #required()} to false.
84+
* The default value to use as a fallback when the request parameter is
85+
* not provided or has an empty value.
86+
* <p>Supplying a default value implicitly sets {@link #required} to
87+
* {@code false}.
8688
*/
8789
String defaultValue() default ValueConstants.DEFAULT_NONE;
8890

spring-web/src/main/java/org/springframework/web/bind/annotation/RequestPart.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,18 @@
7171
String value() default "";
7272

7373
/**
74-
* The name of the part in the "multipart/form-data" request to bind to.
74+
* The name of the part in the {@code "multipart/form-data"} request to bind to.
7575
* @since 4.2
7676
*/
7777
@AliasFor(attribute = "value")
7878
String name() default "";
7979

8080
/**
8181
* Whether the part is required.
82-
* <p>Default is {@code true}, leading to an exception being thrown
83-
* in case the part is missing in the request. Switch this to
84-
* {@code false} if you prefer a {@code null} if the part is missing.
82+
* <p>Defaults to {@code true}, leading to an exception being thrown
83+
* if the part is missing in the request. Switch this to
84+
* {@code false} if you prefer a {@code null} value if the part is
85+
* not present in the request.
8586
*/
8687
boolean required() default true;
8788

0 commit comments

Comments
 (0)