Obtaining supertype/interface type parameter variable type [message #251905] |
Thu, 06 March 2008 09:14 |
Vadim Dmitriev![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=dmgloss%40mail.ru) Messages: 74 Registered: July 2009 |
Member |
|
|
Hi!
Is there any way to get type argument variable type for
supertype/interface?
For example:
class ListWrapper< E, F, B> implements List< F >{ ... }
If IType represents ListWrapper<String, Integer, Object> is there any way
to get type of F type parameter variable of List? (In that case it should
be Integer ). I crawled a little over IType methods and the only useful
one I found was getTypeSuperInterfacesSignatures(), which returned
"QList<QF;>;". getAllSuperInterfaces() of related ITypeHierarchy returns
interfaces with variable names from interface declarations (for List it's
"E"), which is not very helpful here.
Of course the information I seek can be extracted from "QList<QF;>;"
signature, but this way looks a little complicated. Additionally, it
requires traversing interfaces/supertypes tree to find proper "variable
name"->"supertype variable name" mapping. I have hoped that there is an
easier way to do it.
I am pretty new to JDT API, hope that the question is not totally dumb.
Thank you!
|
|
|
Powered by
FUDForum. Page generated in 0.03388 seconds