@Test public void testReturn_SimpleArrayOfArray() throws Exception { Class<?> clazz = Level1Mapper.class; Method method = clazz.getMethod("simpleSelectArrayOfArray"); Type result = TypeParameterResolver.resolveReturnType(method, clazz); assertTrue(result instanceof Class); Class<?> resultClass = (Class<?>) result; assertTrue(resultClass.isArray()); assertTrue(resultClass.getComponentType().isArray()); assertEquals(String.class, resultClass.getComponentType().getComponentType()); }
public static Type resolveReturnType(Method method, Type srcType) { Type returnType = method.getGenericReturnType(); Class<?> declaringClass = method.getDeclaringClass(); return resolveType(returnType, srcType, declaringClass); }
TypeParameterResolver { public static Type resolveReturnType(Method method, Type srcType) { Type returnType = method.getGenericReturnType(); Class<?> declaringClass = method.getDeclaringClass(); return resolveType(returnType, srcType, declaringClass); } }
TypeParameterResolver { public static Type resolveReturnType(Method method, Type srcType) { Type returnType = method.getGenericReturnType(); Class<?> declaringClass = method.getDeclaringClass(); return resolveType(returnType, srcType, declaringClass); } private  TypeParameterResolver(); }
TypeParameterResolver { public static Type resolveReturnType(Method method, Type srcType) { Type returnType = method.getGenericReturnType(); Class<?> declaringClass = method.getDeclaringClass(); return resolveType(returnType, srcType, declaringClass); } private  TypeParameterResolver(); static Type resolveFieldType(Field field, Type srcType); static Type resolveReturnType(Method method, Type srcType); static Type[] resolveParamTypes(Method method, Type srcType); }
TypeParameterResolver { public static Type resolveReturnType(Method method, Type srcType) { Type returnType = method.getGenericReturnType(); Class<?> declaringClass = method.getDeclaringClass(); return resolveType(returnType, srcType, declaringClass); } private  TypeParameterResolver(); static Type resolveFieldType(Field field, Type srcType); static Type resolveReturnType(Method method, Type srcType); static Type[] resolveParamTypes(Method method, Type srcType);  }