Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » How can i get all parameters of an EObject?
How can i get all parameters of an EObject? [message #490636] Fri, 09 October 2009 14:14 Go to next message
lancel lau is currently offline lancel lauFriend
Messages: 31
Registered: July 2009
Member
Hi,
How can i get all parameters of an EObject without knowing the name of the parameter? i think the methode eGet() is what i am looking for, but i am not sure its usage. can anyone give me some example? thanks

regards
Re: How can i get all parameters of an EObject? [message #490639 is a reply to message #490636] Fri, 09 October 2009 14:25 Go to previous message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 702
Registered: July 2009
Senior Member
lancel lau a écrit :
> Hi,
> How can i get all parameters of an EObject without knowing the name of
> the parameter? i think the methode eGet() is what i am looking for, but
> i am not sure its usage. can anyone give me some example? thanks

Something like this:

EObject myObject = ...;
EClass klass = myObject.eClass();
for (EStructuralFeature feature : klass.getEAllStructuralFeatures()) {
String name = feature.getName();
Object value = myObject.eGet(feature);
// Your code here.
}


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Getting two distinct editors in the same window
Next Topic:References by key only.
Goto Forum:
  


Current Time: Tue Apr 16 15:31:21 GMT 2024

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

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

Back to the top