Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

By default, no classes are generated for serialisation, but you can create and use an XMIResource to save and load model instances in the XMI format. However, you will get a better experience by setting the resources type to XMI in the genmodel. In this case, two implementation classes will be generated, for the Resource and Resource.Factory interfaces, respectively. The Resource.Factory is used to create the Resource, which and the Resource is used to save and load model instances (see Serialization). Both the generated classes may be customised, e.g. to adjust save and load options or perform pre- or post-operations when saving and loading.

In addition to generating these classes, they are also the Resource.Factory implementation is configured as the default implementations for your model in plugin.xml, so Eclipse will use them it internally whenever needed, e.g. by the generated editor. This requires that the file extension(s) is set in genmodel, which is done automatically. However, the default value file extension is the EPackage name, which may not be what you want, so you should usually consider it when specifying the resource type.

...