/** * resolves the generic return type of the method */ private static Class<?> resolveReturnType(final Class<?> targetClass, final Method method) { // get the generic return type Type type = method.getGenericReturnType(); // get the actual type argument (expect the type to be a TypeVariable) return resolveType(targetClass, type); }
/** * resolves the generic return type of the method */ private static Class<?> resolveReturnType(final Class<?> targetClass, final Method method) { // get the generic return type Type type = method.getGenericReturnType(); // get the actual type argument (expect the type to be a TypeVariable) return resolveType(targetClass, type); }
/** * resolves the parameter return type of the method */ private static Class<?> resolveParameterType(final Class<?> targetClass, final Method method) { // get the generic parametertypes of the method Type[] types = method.getGenericParameterTypes(); // check for correct argument list length and type if ((types == null) || (types.length < 1)) return null; // get the actual type argument (expect the type to be a TypeVariable) return resolveType(targetClass, types[0]); }
/** * resolves the parameter return type of the method */ private static Class<?> resolveParameterType(final Class<?> targetClass, final Method method) { // get the generic parametertypes of the method Type[] types = method.getGenericParameterTypes(); // check for correct argument list length and type if ((types == null) || (types.length < 1)) return null; // get the actual type argument (expect the type to be a TypeVariable) return resolveType(targetClass, types[0]); }