|
|
|
@ -38,8 +38,8 @@ import org.springframework.cglib.proxy.Enhancer; |
|
|
|
import org.springframework.cglib.proxy.Factory; |
|
|
|
import org.springframework.cglib.proxy.Factory; |
|
|
|
import org.springframework.cglib.proxy.MethodProxy; |
|
|
|
import org.springframework.cglib.proxy.MethodProxy; |
|
|
|
import org.springframework.core.DefaultParameterNameDiscoverer; |
|
|
|
import org.springframework.core.DefaultParameterNameDiscoverer; |
|
|
|
import org.springframework.core.MethodParameter; |
|
|
|
|
|
|
|
import org.springframework.core.MethodIntrospector; |
|
|
|
import org.springframework.core.MethodIntrospector; |
|
|
|
|
|
|
|
import org.springframework.core.MethodParameter; |
|
|
|
import org.springframework.core.ParameterNameDiscoverer; |
|
|
|
import org.springframework.core.ParameterNameDiscoverer; |
|
|
|
import org.springframework.core.annotation.AnnotatedElementUtils; |
|
|
|
import org.springframework.core.annotation.AnnotatedElementUtils; |
|
|
|
import org.springframework.core.annotation.SynthesizingMethodParameter; |
|
|
|
import org.springframework.core.annotation.SynthesizingMethodParameter; |
|
|
|
@ -118,7 +118,7 @@ public class MvcUriComponentsBuilder { |
|
|
|
* @see #fromMethodName(Class, String, Object...) |
|
|
|
* @see #fromMethodName(Class, String, Object...) |
|
|
|
* @see #fromMethodCall(Object) |
|
|
|
* @see #fromMethodCall(Object) |
|
|
|
* @see #fromMappingName(String) |
|
|
|
* @see #fromMappingName(String) |
|
|
|
* @see #fromMethod(java.lang.reflect.Method, Object...) |
|
|
|
* @see #fromMethod(Class, Method, Object...) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected MvcUriComponentsBuilder(UriComponentsBuilder baseUrl) { |
|
|
|
protected MvcUriComponentsBuilder(UriComponentsBuilder baseUrl) { |
|
|
|
Assert.notNull(baseUrl, "'baseUrl' is required"); |
|
|
|
Assert.notNull(baseUrl, "'baseUrl' is required"); |
|
|
|
@ -168,7 +168,7 @@ public class MvcUriComponentsBuilder { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Create a {@link UriComponentsBuilder} from the mapping of a controller |
|
|
|
* Create a {@link UriComponentsBuilder} from the mapping of a controller |
|
|
|
* method and an array of method argument values. This method delegates |
|
|
|
* method and an array of method argument values. This method delegates |
|
|
|
* to {@link #fromMethod(java.lang.reflect.Method, Object...)}. |
|
|
|
* to {@link #fromMethod(Class, Method, Object...)}. |
|
|
|
* @param controllerType the controller |
|
|
|
* @param controllerType the controller |
|
|
|
* @param methodName the method name |
|
|
|
* @param methodName the method name |
|
|
|
* @param args the argument values |
|
|
|
* @param args the argument values |
|
|
|
@ -207,7 +207,7 @@ public class MvcUriComponentsBuilder { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Create a {@link UriComponentsBuilder} by invoking a "mock" controller method. |
|
|
|
* Create a {@link UriComponentsBuilder} by invoking a "mock" controller method. |
|
|
|
* The controller method and the supplied argument values are then used to |
|
|
|
* The controller method and the supplied argument values are then used to |
|
|
|
* delegate to {@link #fromMethod(java.lang.reflect.Method, Object...)}. |
|
|
|
* delegate to {@link #fromMethod(Class, Method, Object...)}. |
|
|
|
* <p>For example, given this controller: |
|
|
|
* <p>For example, given this controller: |
|
|
|
* <pre class="code"> |
|
|
|
* <pre class="code"> |
|
|
|
* @RequestMapping("/people/{id}/addresses") |
|
|
|
* @RequestMapping("/people/{id}/addresses") |
|
|
|
@ -361,7 +361,7 @@ public class MvcUriComponentsBuilder { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* An alternative to {@link #fromMethod(java.lang.reflect.Method, Object...)} |
|
|
|
* An alternative to {@link #fromMethod(Class, Method, Object...)} |
|
|
|
* that accepts a {@code UriComponentsBuilder} representing the base URL. |
|
|
|
* that accepts a {@code UriComponentsBuilder} representing the base URL. |
|
|
|
* This is useful when using MvcUriComponentsBuilder outside the context of |
|
|
|
* This is useful when using MvcUriComponentsBuilder outside the context of |
|
|
|
* processing a request or to apply a custom baseUrl not matching the |
|
|
|
* processing a request or to apply a custom baseUrl not matching the |
|
|
|
@ -557,8 +557,7 @@ public class MvcUriComponentsBuilder { |
|
|
|
* on the controller is invoked, the supplied argument values are remembered |
|
|
|
* on the controller is invoked, the supplied argument values are remembered |
|
|
|
* and the result can then be used to create a {@code UriComponentsBuilder} |
|
|
|
* and the result can then be used to create a {@code UriComponentsBuilder} |
|
|
|
* via {@link #fromMethodCall(Object)}. |
|
|
|
* via {@link #fromMethodCall(Object)}. |
|
|
|
* <p> |
|
|
|
* <p>Note that this is a shorthand version of {@link #controller(Class)} intended |
|
|
|
* Note that this is a shorthand version of {@link #controller(Class)} intended |
|
|
|
|
|
|
|
* for inline use (with a static import), for example: |
|
|
|
* for inline use (with a static import), for example: |
|
|
|
* <pre class="code"> |
|
|
|
* <pre class="code"> |
|
|
|
* MvcUriComponentsBuilder.fromMethodCall(on(FooController.class).getFoo(1)).build(); |
|
|
|
* MvcUriComponentsBuilder.fromMethodCall(on(FooController.class).getFoo(1)).build(); |
|
|
|
@ -574,8 +573,7 @@ public class MvcUriComponentsBuilder { |
|
|
|
* on the controller is invoked, the supplied argument values are remembered |
|
|
|
* on the controller is invoked, the supplied argument values are remembered |
|
|
|
* and the result can then be used to create {@code UriComponentsBuilder} via |
|
|
|
* and the result can then be used to create {@code UriComponentsBuilder} via |
|
|
|
* {@link #fromMethodCall(Object)}. |
|
|
|
* {@link #fromMethodCall(Object)}. |
|
|
|
* <p> |
|
|
|
* <p>This is a longer version of {@link #on(Class)}. It is needed with controller |
|
|
|
* This is a longer version of {@link #on(Class)}. It is needed with controller |
|
|
|
|
|
|
|
* methods returning void as well for repeated invocations. |
|
|
|
* methods returning void as well for repeated invocations. |
|
|
|
* <pre class="code"> |
|
|
|
* <pre class="code"> |
|
|
|
* FooController fooController = controller(FooController.class); |
|
|
|
* FooController fooController = controller(FooController.class); |
|
|
|
@ -778,7 +776,6 @@ public class MvcUriComponentsBuilder { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see #MethodArgumentBuilder(Class, Method) |
|
|
|
|
|
|
|
* @deprecated as of 4.2, this is deprecated in favor of alternative constructors |
|
|
|
* @deprecated as of 4.2, this is deprecated in favor of alternative constructors |
|
|
|
* that accept a controllerType argument |
|
|
|
* that accept a controllerType argument |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|