General polish of new 4.0 classes

Apply consistent styling to new classes introduced in Spring 4.0.

- Javadoc line wrapping, whitespace and formatting
- General code whitespace
- Consistent Assert.notNull messages
This commit is contained in:
Phillip Webb
2013-11-26 14:47:39 -08:00
parent 690051f46c
commit 15698860e1
190 changed files with 350 additions and 695 deletions

View File

@@ -416,12 +416,10 @@ public class DispatcherServlet extends FrameworkServlet {
* Set whether to throw a NoHandlerFoundException when no Handler was found for this request.
* This exception can then be caught with a HandlerExceptionResolver or an
* {@code @ExceptionHandler} controller method.
*
* <p>Note that if
* {@link org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler}
* is used, then requests will always be forwarded to the default servlet and
* a NoHandlerFoundException would never be thrown in that case.
*
* <p>Default is "false", meaning the DispatcherServlet sends a NOT_FOUND error
* through the Servlet response.
* @since 4.0

View File

@@ -1056,10 +1056,8 @@ public abstract class FrameworkServlet extends HttpServletBean implements Applic
* Spring Beans inside an existing {@link WebApplicationContext} rather than
* {@link #findWebApplicationContext() finding} a
* {@link org.springframework.web.context.ContextLoaderListener bootstrapped} context.
*
* <p>Primarily added to support use in embedded servlet containers, this method is not
* intended to be called directly.
*
* @since 4.0
*/
@Override

View File

@@ -20,10 +20,9 @@ import javax.servlet.ServletException;
import org.springframework.http.HttpHeaders;
/**
* Exception to be thrown if DispatcherServlet is unable to determine
* a corresponding handler for an incoming HTTP request.
* The DispatcherServlet throws this exception only if its
* throwExceptionIfNoHandlerFound property is set to "true".
* Exception to be thrown if DispatcherServlet is unable to determine a corresponding
* handler for an incoming HTTP request. The DispatcherServlet throws this exception only
* if its throwExceptionIfNoHandlerFound property is set to "true".
*
* @author Brian Clozel
* @since 4.0

View File

@@ -57,7 +57,6 @@ import java.util.*;
*
* @since 4.0
*/
public class MvcUriComponentsBuilder extends UriComponentsBuilder {
/**
@@ -90,9 +89,7 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder {
* resulting builder contains the current request information up to and including
* the Servlet mapping plus any type-level request mapping. If the controller
* contains multiple mappings, the first one is used.
*
* @param controllerType the controller to create a URI for
*
* @return a UriComponentsBuilder instance
*/
public static UriComponentsBuilder fromController(Class<?> controllerType) {
@@ -106,18 +103,14 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder {
* method name and the number of argument values. If that results in a clash
* (i.e. overloaded methods with the same number of parameters), use
* {@link #fromMethod(java.lang.reflect.Method, Object...)} instead.
* <p>
* The argument values are used to prepare the URI for example expanding
* <p>The argument values are used to prepare the URI for example expanding
* path variables, or adding query parameters. Any other arguments not
* relevant to the URI can be provided as {@literal null} and will be ignored.
* <p>
* Additional (custom) argument types can be supported through an implementation
* <p>Additional (custom) argument types can be supported through an implementation
* of {@link org.springframework.web.method.support.UriComponentsContributor}.
*
* @param controllerType the target controller type
* @param methodName the target method name
* @param argumentValues argument values matching to method parameters
*
* @return a UriComponentsBuilder instance
*/
public static UriComponentsBuilder fromMethodName(Class<?> controllerType,
@@ -147,13 +140,10 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder {
* prepare the URI for example expanding path variables, or adding request
* parameters. Any other arguments not relevant to the URL can be provided as
* {@literal null} and will be ignored.
* <p>
* Additional (custom) argument types can be supported through an implementation
* <p>Additional (custom) argument types can be supported through an implementation
* of {@link org.springframework.web.method.support.UriComponentsContributor}.
*
* @param method the target controller method
* @param argumentValues argument values matching to method parameters
*
* @return a UriComponentsBuilder instance
*/
public static UriComponentsBuilder fromMethod(Method method, Object... argumentValues) {
@@ -172,8 +162,7 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder {
/**
* Create a {@link UriComponents} by invoking a method on a "mock" controller, similar
* to how test frameworks provide mock objects and record method invocations.
* <p>
* For example given this controller:
* <p>For example given this controller:
*
* <pre class="code">
* &#064;RequestMapping("/people/{id}/addresses")
@@ -207,13 +196,10 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder {
*
* The above supports {@code @PathVariable} and {@code @RequestParam} method parameters.
* Any other arguments can be provided as {@literal null} and will be ignored.
* <p>
* Additional (custom) argument types can be supported through an implementation
* <p>Additional (custom) argument types can be supported through an implementation
* of {@link org.springframework.web.method.support.UriComponentsContributor}.
*
* @param methodInvocationInfo either the value returned from a "mock" controller
* invocation or the "mock" controller itself after an invocation
*
* invocation or the "mock" controller itself after an invocation
* @return a UriComponents instance
*/
public static UriComponentsBuilder fromMethodCall(Object methodInvocationInfo) {
@@ -320,15 +306,12 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder {
* on the controller is invoked, the supplied argument values are remembered
* and the result can then be used to prepare a URL to the method via
* {@link #fromMethodCall(Object)}.
* <p>
* This is a shorthand version of {@link #controller(Class)} intended for
* <p>This is a shorthand version of {@link #controller(Class)} intended for
* inline use as follows:
*
* <pre>
* UriComponentsBuilder builder = MvcUriComponentsBuilder.fromMethodCall(
* on(FooController.class).getFoo(1)).build();
* </pre>
*
* @param controllerType the target controller
*/
public static <T> T on(Class<T> controllerType) {
@@ -340,10 +323,8 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder {
* on the controller is invoked, the supplied argument values are remembered
* and the result can then be used to prepare a URL to the method via
* {@link #fromMethodCall(Object)}.
* <p>
* This is a longer version of {@link #on(Class)} for use with void controller
* <p>This is a longer version of {@link #on(Class)} for use with void controller
* methods as well as for creating multiple links in succession.
*
* <pre>
* FooController fooController = controller(FooController.class);
*
@@ -353,7 +334,6 @@ public class MvcUriComponentsBuilder extends UriComponentsBuilder {
* fooController.saveFoo(2, null);
* builder = MvcUriComponentsBuilder.fromMethodCall(fooController);
* </pre>
*
* @param controllerType the target controller
*/
public static <T> T controller(Class<T> controllerType) {