O'Reilly logo

EMF: Eclipse Modeling Framework Second Edition by Frank Budinsky, Ed Merks, Marcelo Paternostro, Dave Steinberg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Java Source Code

If you are more familiar with Java programming than you are with modeling tools, you might find that the easiest way to describe your model is to use Java code. In this chapter, we explore the Java source code constructs and the special annotations that are needed to describe an Ecore model.

As you have seen in Chapter 5, an Ecore model is made up of one or more EPackages, each of which contains a number of EClasses, where each EClass has some number of EAttributes, EReferences, and EOperations. An EPackage can also contain EDataTypes and EEnums. If you specify your model using Java source code, the EClasses are given as Java interfaces. The EAttributes, EReferences, and EOperations will be inferred from the methods ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required