Polish Javadoc for MVC parameter binding annotations

master
Sam Brannen 9 years ago
parent 34204d27f3
commit 8416752645
  1. 21
      spring-web/src/main/java/org/springframework/web/bind/annotation/CookieValue.java
  2. 18
      spring-web/src/main/java/org/springframework/web/bind/annotation/RequestHeader.java
  3. 18
      spring-web/src/main/java/org/springframework/web/bind/annotation/RequestParam.java
  4. 9
      spring-web/src/main/java/org/springframework/web/bind/annotation/RequestPart.java

@ -30,7 +30,7 @@ import org.springframework.core.annotation.AliasFor;
* <p>Supported for annotated handler methods in Servlet and Portlet environments.
*
* <p>The method parameter may be declared as type {@link javax.servlet.http.Cookie}
* or as cookie value type (String, int, etc).
* or as cookie value type (String, int, etc.).
*
* @author Juergen Hoeller
* @author Sam Brannen
@ -62,19 +62,20 @@ public @interface CookieValue {
String name() default "";
/**
* Whether the header is required.
* <p>Default is {@code true}, leading to an exception being thrown
* in case the header is missing in the request. Switch this to
* {@code false} if you prefer a {@code null} in case of the
* missing header.
* <p>Alternatively, provide a {@link #defaultValue}, which implicitly sets
* this flag to {@code false}.
* Whether the cookie is required.
* <p>Defaults to {@code true}, leading to an exception being thrown
* if the cookie is missing in the request. Switch this to
* {@code false} if you prefer a {@code null} value if the cookie is
* not present in the request.
* <p>Alternatively, provide a {@link #defaultValue}, which implicitly
* sets this flag to {@code false}.
*/
boolean required() default true;
/**
* The default value to use as a fallback. Supplying a default value implicitly
* sets {@link #required} to {@code false}.
* The default value to use as a fallback.
* <p>Supplying a default value implicitly sets {@link #required} to
* {@code false}.
*/
String defaultValue() default ValueConstants.DEFAULT_NONE;

@ -29,7 +29,7 @@ import org.springframework.core.annotation.AliasFor;
*
* <p>Supported for annotated handler methods in Servlet and Portlet environments.
*
* <p>If the method parameter is {@link java.util.Map Map&lt;String, String&gt;} or
* <p>If the method parameter is {@link java.util.Map Map&lt;String, String&gt;},
* {@link org.springframework.util.MultiValueMap MultiValueMap&lt;String, String&gt;},
* or {@link org.springframework.http.HttpHeaders HttpHeaders} then the map is
* populated with all header names and values.
@ -63,17 +63,19 @@ public @interface RequestHeader {
/**
* Whether the header is required.
* <p>Default is {@code true}, leading to an exception thrown in case
* of the header missing in the request. Switch this to {@code false}
* if you prefer a {@code null} in case of the header missing.
* <p>Alternatively, provide a {@link #defaultValue}, which implicitly sets
* this flag to {@code false}.
* <p>Defaults to {@code true}, leading to an exception being thrown
* if the header is missing in the request. Switch this to
* {@code false} if you prefer a {@code null} value if the header is
* not present in the request.
* <p>Alternatively, provide a {@link #defaultValue}, which implicitly
* sets this flag to {@code false}.
*/
boolean required() default true;
/**
* The default value to use as a fallback. Supplying a default value implicitly
* sets {@link #required} to {@code false}.
* The default value to use as a fallback.
* <p>Supplying a default value implicitly sets {@link #required} to
* {@code false}.
*/
String defaultValue() default ValueConstants.DEFAULT_NONE;

@ -71,18 +71,20 @@ public @interface RequestParam {
/**
* Whether the parameter is required.
* <p>Default is {@code true}, leading to an exception thrown in case
* of the parameter missing in the request. Switch this to {@code false}
* if you prefer a {@code null} in case of the parameter missing.
* <p>Alternatively, provide a {@link #defaultValue() defaultValue},
* which implicitly sets this flag to {@code false}.
* <p>Defaults to {@code true}, leading to an exception being thrown
* if the parameter is missing in the request. Switch this to
* {@code false} if you prefer a {@code null} value if the parameter is
* not present in the request.
* <p>Alternatively, provide a {@link #defaultValue}, which implicitly
* sets this flag to {@code false}.
*/
boolean required() default true;
/**
* The default value to use as a fallback when the request parameter value
* is not provided or empty. Supplying a default value implicitly sets
* {@link #required()} to false.
* The default value to use as a fallback when the request parameter is
* not provided or has an empty value.
* <p>Supplying a default value implicitly sets {@link #required} to
* {@code false}.
*/
String defaultValue() default ValueConstants.DEFAULT_NONE;

@ -71,7 +71,7 @@ public @interface RequestPart {
String value() default "";
/**
* The name of the part in the "multipart/form-data" request to bind to.
* The name of the part in the {@code "multipart/form-data"} request to bind to.
* @since 4.2
*/
@AliasFor(attribute = "value")
@ -79,9 +79,10 @@ public @interface RequestPart {
/**
* Whether the part is required.
* <p>Default is {@code true}, leading to an exception being thrown
* in case the part is missing in the request. Switch this to
* {@code false} if you prefer a {@code null} if the part is missing.
* <p>Defaults to {@code true}, leading to an exception being thrown
* if the part is missing in the request. Switch this to
* {@code false} if you prefer a {@code null} value if the part is
* not present in the request.
*/
boolean required() default true;

Loading…
Cancel
Save