| How to find a Java element? [message #203280] |
Thu, 12 May 2005 06:22  |
Eclipse User |
|
|
|
Hi,
how do I find a Java element, for example an IType for a Java class, when I
only have the fully qualified class name, like "com.acme.MyClass"? Is there
a query method on the AST, for example?
Similar example: I want to find an IAttribute, using only the fully
qualified class name of the owning Java class and the name of the attribute
itself.
More complex example: the same thing for an operation inside a known class
with a known name and signature.
Cheers...
Matthias
|
|
|
| Re: How to find a Java element? [message #203397 is a reply to message #203280] |
Fri, 13 May 2005 04:43  |
Eclipse User |
|
|
|
Try one of the IJavaProject#findType methods. Once you have the type, you
can use IType#getField or IType#getMethod to navigate.
Cheers
Tobias
"Matthias Bohlen" <infomail@mbohlen.de> wrote in message
news:d5vb9q$o18$1@news.eclipse.org...
> Hi,
>
> how do I find a Java element, for example an IType for a Java class, when
> I
> only have the fully qualified class name, like "com.acme.MyClass"? Is
> there
> a query method on the AST, for example?
>
> Similar example: I want to find an IAttribute, using only the fully
> qualified class name of the owning Java class and the name of the
> attribute
> itself.
>
> More complex example: the same thing for an operation inside a known class
> with a known name and signature.
>
> Cheers...
> Matthias
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02910 seconds