Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-dev] Retrieving, instantiating an IType

Liam,

The search engine is the way to go. You can just give it null for a Progress Monitor if it's not communicating with a GUI.

Instantiating an object of that type might be a challenge: there's no guarantee that the class is on Eclipse's own classpath. Why are you trying to do this?

   David Saff

Liam Morley wrote:

I'd like to go from a fully-qualified class name and retrieve an object of type IType. The class name could be any class within the classpath, or any Java class in any project. The class name is supplied as a string. What's the easiest way to get that? I was looking through the SearchEngine class, but I'm not sure what to supply for a progress monitor etc... I'm not looking to use this with the UI.

After retrieving an IType, I'd like to instantiate an object of that type. Should I go through the java reflection api, or is there some proper Eclipse way of doing this that I'm not aware of?




Back to the top