List of usage examples for org.springframework.web.method HandlerMethod getReturnType
public MethodParameter getReturnType()
From source file:capital.scalable.restdocs.payload.JacksonResponseFieldSnippet.java
private boolean isPageResponse(HandlerMethod handlerMethod) { return handlerMethod.getReturnType().getParameterType() == Page.class; }
From source file:capital.scalable.restdocs.payload.JacksonResponseFieldSnippet.java
@Override protected Type getType(final HandlerMethod method) { Class<?> returnType = method.getReturnType().getParameterType(); if (returnType == ResponseEntity.class) { return firstGenericType(method.getReturnType()); } else if (returnType == Page.class) { return firstGenericType(method.getReturnType()); } else if (isCollection(returnType)) { return new GenericArrayType() { @Override/*ww w . ja va2 s. c o m*/ public Type getGenericComponentType() { return firstGenericType(method.getReturnType()); } }; } else if ("void".equals(returnType.getName())) { return null; } else { return returnType; } }