|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2009 the original author or authors. |
| 2 | + * Copyright 2002-2015 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
23 | 23 | import org.springframework.web.servlet.ModelAndView;
|
24 | 24 |
|
25 | 25 | /**
|
26 |
| - * SPI for resolving custom return values from a specific handler method. Typically implemented to detect special return |
27 |
| - * types, resolving well-known result values for them. |
| 26 | + * SPI for resolving custom return values from a specific handler method. |
| 27 | + * Typically implemented to detect special return types, resolving |
| 28 | + * well-known result values for them. |
28 | 29 | *
|
29 | 30 | * <p>A typical implementation could look like as follows:
|
30 | 31 | *
|
31 | 32 | * <pre class="code">
|
32 | 33 | * public class MyModelAndViewResolver implements ModelAndViewResolver {
|
33 | 34 | *
|
34 |
| - * public ModelAndView resolveModelAndView(Method handlerMethod, |
35 |
| - * Class handlerType, |
36 |
| - * Object returnValue, |
37 |
| - * ExtendedModelMap implicitModel, |
38 |
| - * NativeWebRequest webRequest) { |
39 |
| - * if (returnValue instanceof MySpecialRetVal.class)) { |
40 |
| - * return new MySpecialRetVal(returnValue); |
| 35 | + * public ModelAndView resolveModelAndView(Method handlerMethod, Class handlerType, |
| 36 | + * Object returnValue, ExtendedModelMap implicitModel, NativeWebRequest webRequest) { |
| 37 | + * if (returnValue instanceof MySpecialRetVal.class)) { |
| 38 | + * return new MySpecialRetVal(returnValue); |
| 39 | + * } |
| 40 | + * return UNRESOLVED; |
41 | 41 | * }
|
42 |
| - * return UNRESOLVED; |
43 |
| - * } |
44 | 42 | * }</pre>
|
45 | 43 | *
|
46 | 44 | * @author Arjen Poutsma
|
47 |
| - * @see org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#setCustomModelAndViewResolvers |
48 |
| - * @see org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter#setCustomModelAndViewResolvers |
49 | 45 | * @since 3.0
|
50 | 46 | */
|
51 | 47 | public interface ModelAndViewResolver {
|
52 | 48 |
|
53 |
| - /** Marker to be returned when the resolver does not know how to handle the given method parameter. */ |
| 49 | + /** |
| 50 | + * Marker to be returned when the resolver does not know how to handle the given method parameter. |
| 51 | + */ |
54 | 52 | ModelAndView UNRESOLVED = new ModelAndView();
|
55 | 53 |
|
56 |
| - ModelAndView resolveModelAndView(Method handlerMethod, |
57 |
| - Class handlerType, |
58 |
| - Object returnValue, |
59 |
| - ExtendedModelMap implicitModel, |
60 |
| - NativeWebRequest webRequest); |
| 54 | + |
| 55 | + ModelAndView resolveModelAndView(Method handlerMethod, Class<?> handlerType, Object returnValue, |
| 56 | + ExtendedModelMap implicitModel, NativeWebRequest webRequest); |
| 57 | + |
61 | 58 | }
|
0 commit comments