|
Re: Getting ITypeBinding from a fully qualified class name. Is it possible? [message #259513 is a reply to message #259445] |
Thu, 09 April 2009 12:53 |
Eclipse User |
|
|
|
Originally posted by: alamothe.ptt.yu
Eclipse wrote:
> This question has been asked before but no one gave a universal
> solution.
> ITypeBinding has several methods: isAssignmentCompatible,
> isCastCompatible and isSubTypeCompatible that take an ITypeBinding as
> a parameter.
> I need to use one of this method to check if a ITypeBindig is a
> collection so I want to get an ITypeBinding from
> "java.util.Collection" and then use isSubTypeCompatible. So I need the
> ITypeBinding of java.util.Collection.
>
> AST.resolveWellKnownType only works for well known types. Why there
> is not an AST.resolveType?
When you parse compilation unit(s), you can provide keys for additional
bindings you will be interested in. See ASTParser.createASTs. The only
problem with this approach is that you need to now in advance (at the time
you parsed the unit) which additional bindings you will need.
> Thank you in advance.
>
> Jose M Beleta
|
|
|
|
Powered by
FUDForum. Page generated in 0.03672 seconds