DaRich
DaRich

Reputation: 1027

Force EMF to not override implementation

I want to create a graphical representation for several chained event-listener-pairs based on a JavaFX library (https://github.com/tesis-dynaware/graph-editor). Because EMF is used, further details of the library do not matter. So it could be imagined as a replacement of GEF.

Following diagram shows a minimal example of the data model (for a easier understanding imagine Source rendered next to Sink)

Class diagram

Source and sink are the nodes. Multiple sinks can be connected to one source.

I tried using EMF "annotations" to create the model

/**
 * Concrete message listener.
 * 
 * @model
 */
public class Sink implements MessageListener
{
    @Override
    public void onMessage( MessageEvent e )
    {
        System.out.println( e.getMessage() );
    }
}

but generating the model overwrites my implementation and for example the implements MessageListener is replaced by implements InternalSink. How can I force EMF to not touch my implementation and creating the meta information in a separate file?

Upvotes: 0

Views: 228

Answers (1)

aboyko
aboyko

Reputation: 1572

Annotate generated code (methods, fields, classes) with

@generated NOT

Upvotes: 1

Related Questions