Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Xcore] instance type name?
[Xcore] instance type name? [message #987906] Wed, 28 November 2012 10:56 Go to next message
Bryan Hunt is currently offline Bryan Hunt
Messages: 346
Registered: July 2009
Senior Member
Hi Ed,

I'm trying to create an interface in Xcore that wraps java.lang.Iterable and I'm having problems with the Instance Type Name property.

I specified the interface as:

interface Iterable
{}

and set the Instance Type Name to java.lang.Iterable<EObject>. My class is then specified as:

class MongoCursor extends Iterable
{}

This doesn't seem to work. I get MongoCursor extending the lass Iterable instead of implementing java.lang.Iterable.

Bryan
Re: [Xcore] instance type name? [message #988202 is a reply to message #987906] Wed, 28 November 2012 13:59 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 25910
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Bryan,<br>
<br>
Comments below.<br>
<br>
<div class="moz-cite-prefix">On 28/11/2012 4:56 PM, Bryan Hunt
wrote:<br>
</div>
<blockquote cite="mid:k95c7s$1n3$1@xxxxxxxxe.org" type="cite">Hi
Ed,
<br>
<br>
I'm trying to create an interface in Xcore that wraps
java.lang.Iterable and I'm having problems with the Instance Type
Name property.
<br>
<br>
I specified the interface as:
<br>
<br>
interface Iterable
<br>
{}
<br>
</blockquote>
Did you try something like this?<br>
<br>
<blockquote>import org.eclipse.emf.ecore.EObject<br>
<br>
interface Iterable wraps Iterable&lt;EObject&gt;<br>
{<br>
    <br>
}<br>
<br>
class Foo extends Iterable<br>
{<br>
    <br>
}<br>
</blockquote>
That works for me (other than that I didn't implement the iterator
method yet).<br>
<blockquote cite="mid:k95c7s$1n3$1@xxxxxxxxe.org" type="cite">
<br>
and set the Instance Type Name to
java.lang.Iterable&lt;EObject&gt;.  My class is then specified as:
<br>
<br>
class MongoCursor extends Iterable
<br>
{}
<br>
<br>
This doesn't seem to work.  I get MongoCursor extending the lass
Iterable instead of implementing java.lang.Iterable.
<br>
<br>
Bryan
<br>
</blockquote>
<br>
</body>
</html>
Previous Topic:[EMF] Implementing Instance Model Inheritance
Next Topic:[XSD2ECore] EDataType / AnySimpleType Problem
Goto Forum:
  


Current Time: Tue Jul 22 23:52:46 EDT 2014

Powered by FUDForum. Page generated in 0.01866 seconds