This content has been marked as final. Show 2 replies
For the Class object there's getGenericInterfaces and getGenericSuperclass. For the Field object there's getGenericType. Perhaps other reflection-related classes have methods whose names start with "getGeneric" too.
I had to finesse it a little, but I got it to work with this:
I realize it's not a generic solution, but the point was to see if I could get what I needed. Now I get to make this generic.
MyClass sandbox = new MyClass(); Class<?> c = sandbox.getClass(); Class<?> t = (Class<?>) ((ParameterizedType) c.getDeclaredFields().getGenericType()).getActualTypeArguments();
Thanks for your help