Class EMFHelper


  • public class EMFHelper
    extends Object
    Provides utility functions for EMF models.
    • Constructor Detail

      • EMFHelper

        public EMFHelper()
    • Method Detail

      • getElements

        public EList<EObject> getElements​(EObject root,
                                          EClass type)
        Retrieves all model elements of a given EMF type under some root element.
        Parameters:
        root - the root element
        type - the type of objects to find
        Returns:
        all objects of the given type or a sub type
      • saveToXMIFile

        public static void saveToXMIFile​(EObject modelToSave,
                                         String fileName)
        Save the given EObject to the file given by filename.
        Parameters:
        modelToSave - The EObject to save
        fileName - The filename where to save.
      • loadFromXMIFile

        public static EObject loadFromXMIFile​(String fileName)
        Parameters:
        fileName - the filename specifying the file to load from
        Returns:
        The EObject loaded from the file