Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Having annotated java extend other external interfaces(When annotated java interface extend another interface, it's got driped in generated code)
Having annotated java extend other external interfaces [message #530907] Sun, 02 May 2010 16:45 Go to next message
Alexey  is currently offline Alexey Friend
Messages: 36
Registered: March 2010
Member
Is there any way to preserve in code generation (from annotated java) inheritance from all other java interfaces, both hand coded and regular (like Serializable)? If not, how to preserve manually added interfaces in generated code when you re-generate?

So I have something like:

import my.other.stuff.Abra;
import java.io.Serializable;
/**
* @model
*/
public interface Link extends Abra, Serializable
{...}

After code generation I still have Abra, but Serializable gone, I got

import my.other.stuff.Abra;
import org.eclipse.emf.ecore.EObject;
/**
* @model
*/
public interface Link extends EObject, Abra
{...}

Note that EObject does not extend Serializable
Re: Having annotated java extend other external interfaces [message #530977 is a reply to message #530907] Mon, 03 May 2010 09:10 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Alexey,

You can use @extends or @implements so that the merger will add in stuff
that's not part of the actual model. I'm surprised you didn't end up
with an EClass wrapper for java.io.Serializable in your model though...


Alexey wrote:
> Is there any way to preserve in code generation (from annotated java)
> inheritance from all other java interfaces, both hand coded and
> regular (like Serializable)? If not, how to preserve manually added
> interfaces in generated code when you re-generate?
>
> So I have something like:
>
> import my.other.stuff.Abra;
> import java.io.Serializable;
> /**
> * @model
> */
> public interface Link extends Abra, Serializable
> {...}
>
> After code generation I still have Abra, but Serializable gone, I got
>
> import my.other.stuff.Abra;
> import org.eclipse.emf.ecore.EObject;
> /**
> * @model
> */
> public interface Link extends EObject, Abra {...}
>
> Note that EObject does not extend Serializable


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Some questions about Class.javajet template
Next Topic:Linking different Models
Goto Forum:
  


Current Time: Fri Apr 26 12:46:17 GMT 2024

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

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

Back to the top