Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » In which situation does EClass.getEAllOperations() return a empty list?
In which situation does EClass.getEAllOperations() return a empty list? [message #524542] Thu, 01 April 2010 06:00 Go to next message
Eclipse UserFriend
Originally posted by: lifesting.gmail.com

Hi, gurus, I create a simple EMF model and there's an EClass 'World' in
it, like below:

public interface World extends EObject {

EList<Living> getLivings();


int getCurrentCentury();


void setCurrentCentury(int value);

}

Now I get a handle for a World instance and invoke method
getEAllOperations(), code like below:

World w = ....;
EClass classifier = w.eClass();
EList ops = ((EClass) classifier).getEAllOperations();

//Now ops is an empty list, puzzle~~

Thanks a lot!
Re: In which situation does EClass.getEAllOperations() return a empty list? [message #524547 is a reply to message #524542] Thu, 01 April 2010 11:29 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,
could it be that you are looking for this:
eClass().getEAllStructuralFeatures()
As I think EAllOperations will only return operations not attributes and
references.
regards
Jonas

David Chan wrote:
> Hi, gurus, I create a simple EMF model and there's an EClass 'World' in
> it, like below:
>
> public interface World extends EObject {
>
> EList<Living> getLivings();
>
>
> int getCurrentCentury();
>
>
> void setCurrentCentury(int value);
>
> }
>
> Now I get a handle for a World instance and invoke method
> getEAllOperations(), code like below:
>
> World w = ....;
> EClass classifier = w.eClass();
> EList ops = ((EClass) classifier).getEAllOperations();
>
> //Now ops is an empty list, puzzle~~
>
> Thanks a lot!
Re: In which situation does EClass.getEAllOperations() return a empty list? [message #524724 is a reply to message #524547] Thu, 01 April 2010 22:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lifesting.gmail.com

yeah! you are right, getEAllOperations only return Operations, thank you
very much!
On 4/1/2010 7:29 PM, Jonas wrote:
> Hi,
> could it be that you are looking for this:
> eClass().getEAllStructuralFeatures()
> As I think EAllOperations will only return operations not attributes and
> references.
> regards
> Jonas
>
> David Chan wrote:
>> Hi, gurus, I create a simple EMF model and there's an EClass 'World'
>> in it, like below:
>>
>> public interface World extends EObject {
>>
>> EList<Living> getLivings();
>>
>>
>> int getCurrentCentury();
>>
>> void setCurrentCentury(int value);
>>
>> }
>>
>> Now I get a handle for a World instance and invoke method
>> getEAllOperations(), code like below:
>>
>> World w = ....;
>> EClass classifier = w.eClass();
>> EList ops = ((EClass) classifier).getEAllOperations();
>>
>> //Now ops is an empty list, puzzle~~
>>
>> Thanks a lot!
Re: In which situation does EClass.getEAllOperations() return a empty list? [message #525041 is a reply to message #524724] Mon, 05 April 2010 09:32 Go to previous message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
u re wellcome :-)

David Chan wrote:
> yeah! you are right, getEAllOperations only return Operations, thank you
> very much!
> On 4/1/2010 7:29 PM, Jonas wrote:
>> Hi,
>> could it be that you are looking for this:
>> eClass().getEAllStructuralFeatures()
>> As I think EAllOperations will only return operations not attributes and
>> references.
>> regards
>> Jonas
>>
>> David Chan wrote:
>>> Hi, gurus, I create a simple EMF model and there's an EClass 'World'
>>> in it, like below:
>>>
>>> public interface World extends EObject {
>>>
>>> EList<Living> getLivings();
>>>
>>>
>>> int getCurrentCentury();
>>>
>>> void setCurrentCentury(int value);
>>>
>>> }
>>>
>>> Now I get a handle for a World instance and invoke method
>>> getEAllOperations(), code like below:
>>>
>>> World w = ....;
>>> EClass classifier = w.eClass();
>>> EList ops = ((EClass) classifier).getEAllOperations();
>>>
>>> //Now ops is an empty list, puzzle~~
>>>
>>> Thanks a lot!
>
Previous Topic:Exception thrown org.eclipse.emf.common.util.BasicEList$BasicIndexOutOfBoundsException: index=0, siz
Next Topic:custom eCore annotations and the generated code
Goto Forum:
  


Current Time: Tue Apr 23 13:37:04 GMT 2024

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

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

Back to the top