Class EMFModelComparator

    • Constructor Detail

      • EMFModelComparator

        public EMFModelComparator()
    • Method Detail

      • compare

        public Object compare​(IModel m1,
                              IModel m2)
                       throws Exception
        Description copied from interface: IModelComparator
        Returns an object with the differences between this model and otherModel. If there are no differences, returns null. The exact configuration of the comparison depends on the model. For instance, unique identifiers (such as XMI IDs) may be ignored if the main object of these comparisons is to test model transformations. These tend to produce different unique identifiers each time they are run.
        Specified by:
        compare in interface IModelComparator
        Throws:
        IllegalArgumentException - The models cannot be compared: for instance, they use incompatible drivers.
        Exception - There was some other kind of problem when performing the comparison.
      • saveDeltaToFile

        public File saveDeltaToFile​(Object delta,
                                    File basename)
                             throws IOException
        Description copied from interface: IModelComparator
        Saves the provided delta (as produced by IModelComparator.compare(IModel, IModel) to a file with the provided basename. The actual extension will be picked by this component.
        Specified by:
        saveDeltaToFile in interface IModelComparator
        Parameters:
        delta - Detected model difference (e.g. a Comparison when using EMF Compare).
        basename - File with the desired basename (extension to be picked by comparator).
        Returns:
        File where the delta has been saved, after adding the extension.
        Throws:
        IOException - There was a problem writing to the file.