diff --git a/spring-web/src/main/java/org/springframework/http/MediaType.java b/spring-web/src/main/java/org/springframework/http/MediaType.java index 9f527c7c8ce..173b883d952 100644 --- a/spring-web/src/main/java/org/springframework/http/MediaType.java +++ b/spring-web/src/main/java/org/springframework/http/MediaType.java @@ -284,16 +284,15 @@ public class MediaType implements Comparable { * Create a new {@code MediaType} for the given type, subtype, and character set. * @param type the primary type * @param subtype the subtype - * @param charSet the character set + * @param charset the character set * @throws IllegalArgumentException if any of the parameters contain illegal characters */ - public MediaType(String type, String subtype, Charset charSet) { - this(type, subtype, Collections.singletonMap(PARAM_CHARSET, charSet.name())); + public MediaType(String type, String subtype, Charset charset) { + this(type, subtype, Collections.singletonMap(PARAM_CHARSET, charset.name())); } /** * Create a new {@code MediaType} for the given type, subtype, and quality value. - * * @param type the primary type * @param subtype the subtype * @param qualityValue the quality value @@ -774,18 +773,18 @@ public class MediaType implements Comparable { * Sorts the given list of {@code MediaType} objects by specificity. *

Given two media types: *

    - *
  1. if either media type has a {@linkplain #isWildcardType() wildcard type}, then the media type without the - * wildcard is ordered before the other.
  2. - *
  3. if the two media types have different {@linkplain #getType() types}, then they are considered equal and - * remain their current order.
  4. - *
  5. if either media type has a {@linkplain #isWildcardSubtype() wildcard subtype}, then the media type without - * the wildcard is sorted before the other.
  6. - *
  7. if the two media types have different {@linkplain #getSubtype() subtypes}, then they are considered equal - * and remain their current order.
  8. - *
  9. if the two media types have different {@linkplain #getQualityValue() quality value}, then the media type - * with the highest quality value is ordered before the other.
  10. - *
  11. if the two media types have a different amount of {@linkplain #getParameter(String) parameters}, then the - * media type with the most parameters is ordered before the other.
  12. + *
  13. if either media type has a {@linkplain #isWildcardType() wildcard type}, then the media type without the + * wildcard is ordered before the other.
  14. + *
  15. if the two media types have different {@linkplain #getType() types}, then they are considered equal and + * remain their current order.
  16. + *
  17. if either media type has a {@linkplain #isWildcardSubtype() wildcard subtype}, then the media type without + * the wildcard is sorted before the other.
  18. + *
  19. if the two media types have different {@linkplain #getSubtype() subtypes}, then they are considered equal + * and remain their current order.
  20. + *
  21. if the two media types have different {@linkplain #getQualityValue() quality value}, then the media type + * with the highest quality value is ordered before the other.
  22. + *
  23. if the two media types have a different amount of {@linkplain #getParameter(String) parameters}, then the + * media type with the most parameters is ordered before the other.
  24. *
*

For example: *

audio/basic < audio/* < */*
@@ -807,18 +806,18 @@ public class MediaType implements Comparable { * Sorts the given list of {@code MediaType} objects by quality value. *

Given two media types: *

    - *
  1. if the two media types have different {@linkplain #getQualityValue() quality value}, then the media type - * with the highest quality value is ordered before the other.
  2. - *
  3. if either media type has a {@linkplain #isWildcardType() wildcard type}, then the media type without the - * wildcard is ordered before the other.
  4. - *
  5. if the two media types have different {@linkplain #getType() types}, then they are considered equal and - * remain their current order.
  6. - *
  7. if either media type has a {@linkplain #isWildcardSubtype() wildcard subtype}, then the media type without - * the wildcard is sorted before the other.
  8. - *
  9. if the two media types have different {@linkplain #getSubtype() subtypes}, then they are considered equal - * and remain their current order.
  10. - *
  11. if the two media types have a different amount of {@linkplain #getParameter(String) parameters}, then the - * media type with the most parameters is ordered before the other.
  12. + *
  13. if the two media types have different {@linkplain #getQualityValue() quality value}, then the media type + * with the highest quality value is ordered before the other.
  14. + *
  15. if either media type has a {@linkplain #isWildcardType() wildcard type}, then the media type without the + * wildcard is ordered before the other.
  16. + *
  17. if the two media types have different {@linkplain #getType() types}, then they are considered equal and + * remain their current order.
  18. + *
  19. if either media type has a {@linkplain #isWildcardSubtype() wildcard subtype}, then the media type without + * the wildcard is sorted before the other.
  20. + *
  21. if the two media types have different {@linkplain #getSubtype() subtypes}, then they are considered equal + * and remain their current order.
  22. + *
  23. if the two media types have a different amount of {@linkplain #getParameter(String) parameters}, then the + * media type with the most parameters is ordered before the other.
  24. *
* @param mediaTypes the list of media types to be sorted * @see #getQualityValue() diff --git a/spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodArgumentResolver.java b/spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodArgumentResolver.java index b3c34427910..57823245fee 100644 --- a/spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodArgumentResolver.java +++ b/spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodArgumentResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,6 @@ public interface HandlerMethodArgumentResolver { /** * Whether the given {@linkplain MethodParameter method parameter} is * supported by this resolver. - * * @param parameter the method parameter to check * @return {@code true} if this resolver supports the supplied parameter; * {@code false} otherwise @@ -46,7 +45,6 @@ public interface HandlerMethodArgumentResolver { * request. A {@link WebDataBinderFactory} provides a way to create * a {@link WebDataBinder} instance when needed for data binding and * type conversion purposes. - * * @param parameter the method parameter to resolve. This parameter must * have previously been passed to * {@link #supportsParameter(org.springframework.core.MethodParameter)} @@ -57,9 +55,7 @@ public interface HandlerMethodArgumentResolver { * @return the resolved argument value, or {@code null}. * @throws Exception in case of errors with the preparation of argument values */ - Object resolveArgument(MethodParameter parameter, - ModelAndViewContainer mavContainer, - NativeWebRequest webRequest, - WebDataBinderFactory binderFactory) throws Exception; + Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, + NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception; } diff --git a/spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodReturnValueHandler.java b/spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodReturnValueHandler.java index ae1afc1155f..55ee1e30a8c 100644 --- a/spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodReturnValueHandler.java +++ b/spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodReturnValueHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,6 @@ public interface HandlerMethodReturnValueHandler { /** * Whether the given {@linkplain MethodParameter method return type} is * supported by this handler. - * * @param returnType the method return type to check * @return {@code true} if this handler supports the supplied return type; * {@code false} otherwise @@ -43,7 +42,6 @@ public interface HandlerMethodReturnValueHandler { * setting a view or setting the * {@link ModelAndViewContainer#setRequestHandled} flag to {@code true} * to indicate the response has been handled directly. - * * @param returnValue the value returned from the handler method * @param returnType the type of the return value. This type must have * previously been passed to @@ -53,9 +51,7 @@ public interface HandlerMethodReturnValueHandler { * @param webRequest the current request * @throws Exception if the return value handling results in an error */ - void handleReturnValue(Object returnValue, - MethodParameter returnType, - ModelAndViewContainer mavContainer, - NativeWebRequest webRequest) throws Exception; + void handleReturnValue(Object returnValue, MethodParameter returnType, + ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws Exception; }