|
|
Re: Collections as return types of EOperations [message #422966 is a reply to message #422962] |
Fri, 19 September 2008 16:37 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------030200030204050109090500
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Guys,
If you use "Sample Ecore Editor -> Show Generics", it's also possible to
create an EDataType for java.util.Set (much like the one in Ecore.ecore
for EEList) and then to use a generic type that refers to your "Set"
EDataType has has a type argument (use the create child menus for that)
for the MyModelType (much like EObject's eContents EOperation in
Ecore.ecore).
Tom Schindl wrote:
> Hi,
>
> Create your own EDataType where you wrap the java-Set-interface, or did
> I get this wrong?
>
> Tom
>
> Eric Rizzo schrieb:
>
>> How can I define an EOperation whose return type is a typed collection.
>> What I want generated is this:
>>
>> public Set<MyModelType> getFoo();
>>
>> If Set isn't possible or easy, I'd settle for Collection<MyModelType> or
>> List<MyModelType>.
>>
>>
>> In the ecore editor I can't seem to find anything appropriate to select
>> as the EType property of my EOperation.
>>
>> Thanks in advance,
>> Eric
>>
>
>
>
--------------030200030204050109090500
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Guys,<br>
<br>
If you use "Sample Ecore Editor -> Show Generics", it's also
possible to create an EDataType for java.util.Set (much like the one in
Ecore.ecore for EEList) and then to use a generic type that refers to
your "Set" EDataType has has a type argument (use the create child
menus for that) for the MyModelType (much like EObject's eContents
EOperation in Ecore.ecore).<br>
<br>
<br>
Tom Schindl wrote:
<blockquote cite="mid:gb0jof$krl$1@build.eclipse.org" type="cite">
<pre wrap="">Hi,
Create your own EDataType where you wrap the java-Set-interface, or did
I get this wrong?
Tom
Eric Rizzo schrieb:
</pre>
<blockquote type="cite">
<pre wrap="">How can I define an EOperation whose return type is a typed collection.
What I want generated is this:
public Set<MyModelType> getFoo();
If Set isn't possible or easy, I'd settle for Collection<MyModelType> or
List<MyModelType>.
In the ecore editor I can't seem to find anything appropriate to select
as the EType property of my EOperation.
Thanks in advance,
Eric
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
</body>
</html>
--------------030200030204050109090500--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.01437 seconds