Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Implemementing an external interface in XCore(Problem defining a Class that implement an external interface in XCore)
Implemementing an external interface in XCore [message #1752018] Tue, 17 January 2017 21:22 Go to next message
Pierre Allard is currently offline Pierre AllardFriend
Messages: 6
Registered: February 2016
Junior Member
Hi all,

I am trying to create an XCore model that defines classes that implement the java.util.Comparator interface for various types of EObject. Here is the model I created to try this out (attached to this post):

@GenModel(prefix="Tests",
childCreationExtenders="true",
extensibleProviderFactory="true",
multipleEditorPages="false")
@GenModel(modelDirectory="/test/src-generated")
@GenModel(editDirectory="/test.edit/src-generated")

package tests

type MyComparator<T> wraps java.util.Comparator

class SomeClassA
{
}

class SomeClassB
{
}

interface IComparator<T> wraps java.util.Comparator<T>
{
}

class MyAComparator extends IComparator<SomeClassA>
{
}

class MyBComparator extends IComparator<SomeClassB>
{
}

The problem I get is that the code generated does for the MyAComparator.java looks like this:

package tests;

import java.util.Comparator;

import org.eclipse.emf.ecore.EObject;

/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>My AComparator</b></em>'.
* <!-- end-user-doc -->
*
*
* @see tests.TestsPackage#getMyAComparator()
* @model superTypes="tests.IComparator<tests.SomeClassA>"
* @generated
*/
public interface MyAComparator extends EObject, Comparator<void><SomeClassA> {
} // MyAComparator

This obviously does not compile. The same problem with the MyBComparator.java. The adapter factory and switch interface have similar problems in the code.

What am I doing wrong ?
  • Attachment: test.xcore
    (Size: 0.51KB, Downloaded 76 times)
Re: Implemementing an external interface in XCore [message #1752117 is a reply to message #1752018] Thu, 19 January 2017 03:44 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Yes, I can reproduce that problem. Please open a Bugzilla.

Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[Xcore] control whether ecore file is generated or not
Next Topic:[CDO] High level change notifications between clients
Goto Forum:
  


Current Time: Fri Apr 19 13:46:53 GMT 2024

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

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

Back to the top