Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » How to Convert a java file to "IType" ?
How to Convert a java file to "IType" ? [message #414441] Wed, 07 November 2007 08:19 Go to next message
Eclipse UserFriend
Originally posted by: lgw198412.gmail.com

Hi:
I'm confusing in the following problem:
There's a java file ,I can use Java I/O Stream to read it into a String
Objecet.But I want to analyze it to know the methods and fields in this java
file ,just like the Java Refelction Mechanism. And I found that in eclipse
there's an type called "IType" could do this thing,but I
don't know how to establish such an IType object and set the data(String
object) to it.Please help me ,or give me some other suggestions to this
subject!
Thank you!
robbin
from China
Re: How to Convert a java file to "IType" ? [message #414443 is a reply to message #414441] Wed, 07 November 2007 09:13 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
Registered: July 2009
Senior Member
robbin wrote:
> Hi:
> I'm confusing in the following problem:
> There's a java file ,I can use Java I/O Stream to read it into a String
> Objecet.But I want to analyze it to know the methods and fields in this
> java
> file ,just like the Java Refelction Mechanism. And I found that in eclipse
> there's an type called "IType" could do this thing,but I
> don't know how to establish such an IType object and set the data(String
> object) to it.Please help me ,or give me some other suggestions to this
> subject!
> Thank you!
> robbin
> from China
>

I don´ t know what thsis has to do with the EMF, next time better ask
such questions in a forum about general java questions.

Just load the Class using Class.forName(...), the File containing the
class/interface/whatever... must be on the classpath. Then you get a
Class object and can use reflection.
Re: How to Convert a java file to "IType" ? [message #414453 is a reply to message #414441] Wed, 07 November 2007 14:00 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Robbin,

You asked this same question on the foundation newsgroup too. Please
avoid posting the same question to multiple groups as separate postings.


robbin wrote:
> Hi:
> I'm confusing in the following problem:
> There's a java file ,I can use Java I/O Stream to read it into a String
> Objecet.But I want to analyze it to know the methods and fields in
> this java
> file ,just like the Java Refelction Mechanism. And I found that in
> eclipse
> there's an type called "IType" could do this thing,but I
> don't know how to establish such an IType object and set the data(String
> object) to it.Please help me ,or give me some other suggestions to this
> subject!
> Thank you!
> robbin
> from China
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How to Convert a java file to "IType" ? [message #414455 is a reply to message #414453] Wed, 07 November 2007 14:54 Go to previous message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
Registered: July 2009
Senior Member
> You asked this same question on the foundation newsgroup too.

And on the Visual Editor newsgroup too!
Previous Topic:ClassCastException when deleting an object with a volatile reference
Next Topic:EMF R2_3_maintenance does not affect all projects
Goto Forum:
  


Current Time: Fri Apr 26 03:11:09 GMT 2024

Powered by FUDForum. Page generated in 0.04262 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top