Generating an Extended EMF Model

Top    Previous: Prerequisites     Next: Generating the EMF Model and the Editor

Step 1b: Creating a New EMF Model from Java Interfaces

Here are the annotated Java interfaces for the "schoollibrary" package. We can create the GenModel from these interface files instead of a Rose model.
SchoolLibrary.java
package org.eclipse.example.schoollibrary;

import org.eclipse.example.library.Library;

/**
 *
@model
 */
public interface
SchoolLibrary extends Library
{
  /**
   *
@model
   */
  String getLocation();
}
Asset.java
package org.eclipse.example.schoollibrary;

/**
 *
@model
 */
public interface
Asset
{
  /**
   *
@model
   */
  float getValue();
}
SchoolBook.java
package org.eclipse.example.schoollibrary;

import org.eclipse.example.library.Book;

/**
 *
@model
 */
public interface
SchoolBook extends Book, Asset
{
}



  1. Create a Java Project

  2. Import the Interfaces

    You can create and type in the interfaces as in the previous tutorial, but we will show here how to import them from the zip file schoollibrary.zip.

  3. Create the Gen(erate) Model


Top    Previous: Prerequisites    Next: Generating the EMF Model and the Editor