Polishing
This commit is contained in:
@@ -33,12 +33,13 @@ import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* {@link ReflectiveProcessor} implementation for {@link Controller} and
|
||||
* controller-specific annotated methods. On top of registering reflection
|
||||
* controller-specific annotated methods. In addition to registering reflection
|
||||
* hints for invoking the annotated method, this implementation handles:
|
||||
*
|
||||
* <ul>
|
||||
* <li>Return types annotated with {@link ResponseBody}.</li>
|
||||
* <li>Parameters annotated with {@link RequestBody}.</li>
|
||||
* <li>{@link HttpEntity} return type and parameters.</li>
|
||||
* <li>Return types annotated with {@link ResponseBody}</li>
|
||||
* <li>Parameters annotated with {@link RequestBody}</li>
|
||||
* <li>{@link HttpEntity} return types and parameters</li>
|
||||
* </ul>
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
@@ -49,6 +50,7 @@ class ControllerMappingReflectiveProcessor implements ReflectiveProcessor {
|
||||
|
||||
private final BindingReflectionHintsRegistrar bindingRegistrar = new BindingReflectionHintsRegistrar();
|
||||
|
||||
|
||||
@Override
|
||||
public void registerReflectionHints(ReflectionHints hints, AnnotatedElement element) {
|
||||
if (element instanceof Class<?> type) {
|
||||
@@ -98,8 +100,8 @@ class ControllerMappingReflectiveProcessor implements ReflectiveProcessor {
|
||||
@Nullable
|
||||
private Type getHttpEntityType(MethodParameter parameter) {
|
||||
MethodParameter nestedParameter = parameter.nested();
|
||||
return (nestedParameter.getNestedParameterType() == nestedParameter.getParameterType()
|
||||
? null : nestedParameter.getNestedParameterType());
|
||||
return (nestedParameter.getNestedParameterType() == nestedParameter.getParameterType() ?
|
||||
null : nestedParameter.getNestedParameterType());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -37,4 +37,5 @@ class ExceptionHandlerReflectiveProcessor extends ControllerMappingReflectivePro
|
||||
}
|
||||
super.registerReturnTypeHints(hints, returnTypeParameter);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* {@link ReflectiveProcessor} implementation for {@link HttpExchange @HttpExchange}
|
||||
* and annotated methods. On top of registering reflection hints for invoking
|
||||
* annotated methods. In addition to registering reflection hints for invoking
|
||||
* the annotated method, this implementation handles reflection-based
|
||||
* binding for return types and parameters annotated with {@link RequestBody}.
|
||||
*
|
||||
@@ -40,6 +40,7 @@ class HttpExchangeReflectiveProcessor implements ReflectiveProcessor {
|
||||
|
||||
private final BindingReflectionHintsRegistrar bindingRegistrar = new BindingReflectionHintsRegistrar();
|
||||
|
||||
|
||||
@Override
|
||||
public void registerReflectionHints(ReflectionHints hints, AnnotatedElement element) {
|
||||
if (element instanceof Method method) {
|
||||
|
||||
Reference in New Issue
Block a user