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>Supported for annotated handler methods in Servlet and Portlet environments.
* *
* <p>The method parameter may be declared as type {@link javax.servlet.http.Cookie} * <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 Juergen Hoeller
* @author Sam Brannen * @author Sam Brannen
@ -62,19 +62,20 @@ public @interface CookieValue {
String name() default ""; String name() default "";
/** /**
* Whether the header is required. * Whether the cookie is required.
* <p>Default is {@code true}, leading to an exception being thrown * <p>Defaults to {@code true}, leading to an exception being thrown
* in case the header is missing in the request. Switch this to * if the cookie is missing in the request. Switch this to
* {@code false} if you prefer a {@code null} in case of the * {@code false} if you prefer a {@code null} value if the cookie is
* missing header. * not present in the request.
* <p>Alternatively, provide a {@link #defaultValue}, which implicitly sets * <p>Alternatively, provide a {@link #defaultValue}, which implicitly
* this flag to {@code false}. * sets this flag to {@code false}.
*/ */
boolean required() default true; boolean required() default true;
/** /**
* The default value to use as a fallback. Supplying a default value implicitly * The default value to use as a fallback.
* sets {@link #required} to {@code false}. * <p>Supplying a default value implicitly sets {@link #required} to
* {@code false}.
*/ */
String defaultValue() default ValueConstants.DEFAULT_NONE; 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>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;}, * {@link org.springframework.util.MultiValueMap MultiValueMap&lt;String, String&gt;},
* or {@link org.springframework.http.HttpHeaders HttpHeaders} then the map is * or {@link org.springframework.http.HttpHeaders HttpHeaders} then the map is
* populated with all header names and values. * populated with all header names and values.
@ -63,17 +63,19 @@ public @interface RequestHeader {
/** /**
* Whether the header is required. * Whether the header is required.
* <p>Default is {@code true}, leading to an exception thrown in case * <p>Defaults to {@code true}, leading to an exception being thrown
* of the header missing in the request. Switch this to {@code false} * if the header is missing in the request. Switch this to
* if you prefer a {@code null} in case of the header missing. * {@code false} if you prefer a {@code null} value if the header is
* <p>Alternatively, provide a {@link #defaultValue}, which implicitly sets * not present in the request.
* this flag to {@code false}. * <p>Alternatively, provide a {@link #defaultValue}, which implicitly
* sets this flag to {@code false}.
*/ */
boolean required() default true; boolean required() default true;
/** /**
* The default value to use as a fallback. Supplying a default value implicitly * The default value to use as a fallback.
* sets {@link #required} to {@code false}. * <p>Supplying a default value implicitly sets {@link #required} to
* {@code false}.
*/ */
String defaultValue() default ValueConstants.DEFAULT_NONE; String defaultValue() default ValueConstants.DEFAULT_NONE;

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

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

Loading…
Cancel
Save