Improved reactive type descriptor support

ReactiveTypeDescriptor is now a top-level type with named constructors.
It also contains and provides a getter for the actual type.

Issue: SPR-14902
This commit is contained in:
Rossen Stoyanchev
2016-11-24 15:56:50 -05:00
parent 4f37fdb133
commit 2e7d16df04
5 changed files with 184 additions and 102 deletions

View File

@@ -25,7 +25,7 @@ import reactor.core.publisher.MonoProcessor;
import org.springframework.beans.BeanUtils;
import org.springframework.core.MethodParameter;
import org.springframework.core.ReactiveAdapter;
import org.springframework.core.ReactiveAdapter.Descriptor;
import org.springframework.core.ReactiveTypeDescriptor;
import org.springframework.core.ReactiveAdapterRegistry;
import org.springframework.core.ResolvableType;
import org.springframework.core.annotation.AnnotationUtils;
@@ -107,7 +107,7 @@ public class ModelAttributeMethodArgumentResolver implements HandlerMethodArgume
Class<?> clazz = parameter.getParameterType();
ReactiveAdapter adapter = getAdapterRegistry().getAdapterFrom(clazz);
if (adapter != null) {
Descriptor descriptor = adapter.getDescriptor();
ReactiveTypeDescriptor descriptor = adapter.getDescriptor();
if (descriptor.isNoValue() || descriptor.isMultiValue()) {
return false;
}