|
Re: How to get value of an EAttribute? [message #641346 is a reply to message #641340] |
Thu, 25 November 2010 07:00 |
|
Hi Bharani,
By the question, do u mean that you wanted to retrieve all the Attributes within a class????
You can do that as follows:-
EList<EClassifier> eClassifiers = PurchaseOrderPackage.eINSTANCE.getEClassifiers();
The above code will retrieve you all the EClasses. Then you can retrieve the attributes from each EClass.
for (EClassifier eclass : eClassifiers) {
EList<EAttribute> eAllAttributes = ((EClass) eclass).getEAllAttributes();
EList<EAttribute> eLocalAttributesofTheClass = ((EClass) eclass).getEAttributes();
}
Regards,
Animesh
|
|
|
|
|
|
Re: How to get value of an EAttribute? [message #641462 is a reply to message #641347] |
Thu, 25 November 2010 15:06 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
Bharani,
Try to maintain a single thread for your one question. Given that you
have a generated API and are talking about wanting to use instances in a
template language, I imagine you should just be casting to your
generated API's instances and using the API methods to access all the
data. Using EObject.eGet is fine when writing purely generic code, but
my guess is that's not what you're doing...
Bharani wrote:
> Hi Animesh,
>
> I'm able to retrieve eattributes. what i want to get is the value of
> the attribute that is set through the editor(developed using GMF). For
> eg, the value of quantity, price from item object etc.
>
> regards,
> Bharani
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02670 seconds