Skip to main content



      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 16:22 Go to next message
Eclipse UserFriend
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 97 times)
Re: Implemementing an external interface in XCore [message #1752117 is a reply to message #1752018] Wed, 18 January 2017 22:44 Go to previous message
Eclipse UserFriend
Yes, I can reproduce that problem. Please open a Bugzilla.
Previous Topic:[Xcore] control whether ecore file is generated or not
Next Topic:[CDO] High level change notifications between clients
Goto Forum:
  


Current Time: Wed Jul 16 08:54:04 EDT 2025

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

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

Back to the top