List of usage examples for org.springframework.core MethodParameter getConstructor
@Nullable
public Constructor<?> getConstructor()
From source file:org.springframework.core.GenericTypeResolver.java
/** * Determine the target type for the given parameter specification. * @param methodParam the method parameter specification * @return the corresponding generic parameter type *//*w w w. j av a 2s .c o m*/ public static Type getTargetType(MethodParameter methodParam) { Assert.notNull(methodParam, "MethodParameter must not be null"); if (methodParam.getConstructor() != null) { return methodParam.getConstructor().getGenericParameterTypes()[methodParam.getParameterIndex()]; } else { if (methodParam.getParameterIndex() >= 0) { return methodParam.getMethod().getGenericParameterTypes()[methodParam.getParameterIndex()]; } else { return methodParam.getMethod().getGenericReturnType(); } } }