Interface IModelComparator

  • All Known Implementing Classes:
    EMFModelComparator

    public interface IModelComparator
    Interface for a model comparator. They compare entire models and return a set of relevant differences, if any exist. Comparators may only be able to compare certain models, based on various criteria.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String EXTENSION_POINT_ID  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean canCompare​(IModel expectedModel, IModel obtainedModel)
      Checks if the comparator can compare these two models.
      java.lang.Object compare​(IModel expectedModel, IModel obtainedModel)
      Returns an object with the differences between this model and otherModel.
      void configure​(java.util.Map<java.lang.String,​java.lang.Object> options)
      Configures the model comparator with the specified options.
    • Field Detail

    • Method Detail

      • canCompare

        boolean canCompare​(IModel expectedModel,
                           IModel obtainedModel)
        Checks if the comparator can compare these two models.
        Returns:
        true if compare(IModel, IModel) should finish successfully, and false otherwise.
      • compare

        java.lang.Object compare​(IModel expectedModel,
                                 IModel obtainedModel)
                          throws java.lang.Exception
        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.
        Throws:
        java.lang.IllegalArgumentException - The models cannot be compared: for instance, they use incompatible drivers.
        java.lang.Exception - There was some other kind of problem when performing the comparison.
      • configure

        void configure​(java.util.Map<java.lang.String,​java.lang.Object> options)
        Configures the model comparator with the specified options.
        Throws:
        java.lang.IllegalArgumentException - One of the options has an invalid value is or not available.