Skip to main content


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 17:51 Go to next message
Tamar Cohen is currently offline Tamar CohenFriend
Messages: 103
Registered: July 2009
Senior 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 18:12 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
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: Fri Apr 26 11:39:36 GMT 2024

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

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

Back to the top