Here's the recipe:
- First extract the genericSuperclass
- Retrieve the actual type arguments
.. and the code is:
ParameterizedType type = (ParameterizedType) getClass().getGenericSuperclass();
Class
ParameterizedType represents an invocation of a generic class or interface, better explanation could be read in the javadoc.
That's all... :)
No comments:
Post a Comment