mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-23 06:29:10 +00:00
HttpRequestValues.Processor exposes MethodParameter[]
Closes gh-35148
This commit is contained in:
+3
-1
@@ -27,6 +27,7 @@ import java.util.function.Consumer;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.core.ParameterizedTypeReference;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
@@ -240,11 +241,12 @@ public class HttpRequestValues {
|
||||
* Invoked after argument resolvers have been called, and before the
|
||||
* {@link HttpRequestValues} is built.
|
||||
* @param method the {@code @HttpExchange} method
|
||||
* @param parameters provides access to method parameter information
|
||||
* @param arguments the raw argument values to the method
|
||||
* @param builder the builder to add request values too; the builder
|
||||
* also exposes method {@link Metadata} from the {@code HttpExchange} method.
|
||||
*/
|
||||
void process(Method method, @Nullable Object[] arguments, Builder builder);
|
||||
void process(Method method, MethodParameter[] parameters, @Nullable Object[] arguments, Builder builder);
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -133,7 +133,7 @@ final class HttpServiceMethod {
|
||||
public @Nullable Object invoke(@Nullable Object[] arguments) {
|
||||
HttpRequestValues.Builder requestValues = this.requestValuesInitializer.initializeRequestValuesBuilder();
|
||||
applyArguments(requestValues, arguments);
|
||||
this.requestValuesProcessor.process(this.method, arguments, requestValues);
|
||||
this.requestValuesProcessor.process(this.method, this.parameters, arguments, requestValues);
|
||||
return this.responseFunction.execute(requestValues.build());
|
||||
}
|
||||
|
||||
|
||||
+6
-2
@@ -32,6 +32,7 @@ import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.aop.framework.ReflectiveMethodInvocation;
|
||||
import org.springframework.core.KotlinDetector;
|
||||
import org.springframework.core.MethodIntrospector;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.core.annotation.AnnotatedElementUtils;
|
||||
import org.springframework.core.convert.ConversionService;
|
||||
import org.springframework.format.support.DefaultFormattingConversionService;
|
||||
@@ -302,9 +303,12 @@ public final class HttpServiceProxyFactory {
|
||||
implements HttpRequestValues.Processor {
|
||||
|
||||
@Override
|
||||
public void process(Method method, @Nullable Object[] arguments, HttpRequestValues.Builder builder) {
|
||||
public void process(
|
||||
Method method, MethodParameter[] parameters, @Nullable Object[] arguments,
|
||||
HttpRequestValues.Builder builder) {
|
||||
|
||||
for (HttpRequestValues.Processor processor : this.processors) {
|
||||
processor.process(method, arguments, builder);
|
||||
processor.process(method, parameters, arguments, builder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user