Add shortcut to register an executable with a mode

See gh-29011
This commit is contained in:
Stephane Nicoll
2022-08-24 15:44:54 +02:00
parent c164b918c0
commit 5aa8583159
8 changed files with 56 additions and 29 deletions

View File

@@ -63,13 +63,13 @@ class RequestMappingReflectiveProcessor implements ReflectiveProcessor {
}
protected void registerMethodHints(ReflectionHints hints, Method method) {
hints.registerMethod(method, hint -> hint.withMode(ExecutableMode.INVOKE));
hints.registerMethod(method, ExecutableMode.INVOKE);
registerParameterHints(hints, method);
registerReturnValueHints(hints, method);
}
protected void registerParameterHints(ReflectionHints hints, Method method) {
hints.registerMethod(method, hint -> hint.withMode(ExecutableMode.INVOKE));
hints.registerMethod(method, ExecutableMode.INVOKE);
for (Parameter parameter : method.getParameters()) {
MethodParameter methodParameter = MethodParameter.forParameter(parameter);
if (methodParameter.hasParameterAnnotation(RequestBody.class) ||