Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Modeling (top-level project) » I have a class. How do I get it's structural features?
I have a class. How do I get it's structural features? [message #618270] Tue, 03 November 2009 12:51 Go to next message
Tamar Cohen is currently offline Tamar Cohen
Messages: 89
Registered: July 2009
Member
Hello --

I'm using reflection to do all sorts of cool automated things which I am HOPING I can contribute back to the open source world. However, I have one bit of ugliness:

I have a class. Not an EClass, just a plain class. I need to get its EStructuralFeatures. How do I do that? How can I look up a factory if I just have a class? Is there a way for me to get an EClass from a class? Mind you, I don't have an instance of the class, I just have the class itself.

thanks much

Tamar
Re: I have a class. How do I get it's structural features? [message #618271 is a reply to message #618270] Tue, 03 November 2009 13:12 Go to previous message
Eike Stepper is currently offline Eike Stepper
Messages: 5481
Registered: July 2009
Senior Member
Hi Tamar,

Comments below...


Tamar Cohen schrieb:
> Hello --
>
> I'm using reflection to do all sorts of cool automated things which I
> am HOPING I can contribute back to the open source world.
I'm curious, what are you doing?

> However, I have one bit of ugliness:
> I have a class. Not an EClass, just a plain class.
Why don't you use EMF reflection?

> I need to get its EStructuralFeatures. How do I do that? How can I
> look up a factory if I just have a class?
What factory do you mean?

> Is there a way for me to get an EClass from a class? Mind you, I
> don't have an instance of the class, I just have the class itself.
I assume that you could determine the EClass of a java.lang.Class if you
have the GenModel of that EClass at hand. You'd have to traverse all
GenModels.

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Previous Topic:[ANNOUNCE] Call for Speakers CG2010
Next Topic:I have a class. How do I get it's structural features?
Goto Forum:
  


Current Time: Mon Jul 28 00:18:54 EDT 2014

Powered by FUDForum. Page generated in 0.01741 seconds